In one of intervie, my interviwer asked, I have a file
which contains 4 records I would like to split the 4
different outputs for each record how to do?

Answer Posted / kiran

You can use OUTFIL's SPLIT parameter to put the first
record into OUTPUT1, the second record into OUTPUT2, the
third record into OUTPUT1, the fourth record into OUTPUT2,
and so on until you run out of records. SPLIT splits the
records one at a time among the data sets specified by
FNAMES. The following statements split the records between
two OUTFIL data sets:
OPTION COPY
OUTFIL FNAMES=(Op1.op2,op3,op4),SPLIT
Similarly, OUTFIL's SPLITBY=n parameter splits the records
n at a time among the data sets specified by FNAMES. The
following statements split the records four at a time
between three OUTFIL data sets:

OPTION COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLITBY=4

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

1751


The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?

945


How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?

718


what is DSN parameter and DISP parameter is used for?

677


Is acct parameter mandatory?

763






How gdg are concatenated?

672


a dd statement has 2 types of parameters. Name them?

649


Is it possible to left uncode disp?

713


how to do automated restart when a job abends?

854


which utility is used to run a cobol-db2 program?

810


State the uses of syspring, sysin, sort fields, sum fields and dummy.

654


How to do automated restart when a job abend?

791


Name the parameters which can be used to limit the number of records written to a sysout dataset?

654


How can values be passed from the job stream to an executable program?

875


Differentiate between addressing mode and run mode.

615