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
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) ?
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 ?
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?
what is DSN parameter and DISP parameter is used for?
Is acct parameter mandatory?
How gdg are concatenated?
a dd statement has 2 types of parameters. Name them?
Is it possible to left uncode disp?
how to do automated restart when a job abends?
which utility is used to run a cobol-db2 program?
State the uses of syspring, sysin, sort fields, sum fields and dummy.
How to do automated restart when a job abend?
Name the parameters which can be used to limit the number of records written to a sysout dataset?
How can values be passed from the job stream to an executable program?
Differentiate between addressing mode and run mode.