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
How is a type of file defined in the jcl that executes the cobol program?
a set statement is used to define commonly used symbolic across job steps or procedures. It initializes the previous values in the symbolic names. It has to be defined before the first use of the symbolic names in the jcl. State whether true or false?
When output dataset space is required, what quantity categories are used?
Explain the jcl exec statement?
I have mainpgm(abc) this is the only cobol pgm(non-db2).And this pgm calling subpgm name "acd" this also only cobol(non- Db)and this pgm calling some other subpgm this pgm has cobol-db2 pgm. 1) IF you calling static mode how to run and how to compile? 2) IF you calling dynamic mode how to run and how to compile? plz suggestion me.
What are steplib and joblib?
have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records... run a loop from record one to 10 evaluate i/3 if comes even then skip else write to output file
what is use of dcb parameter in dd statement?
In job processing, what happens in execution stage?
How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
What is the significance of addrspc parameter in exec statement?
What is the function of a dd statement?
What are the parameters that are used in creating a gdg?
Explain the function of job statement in jcl?
Explain how can the disposition of sysout datasets be set for an entire jobstream?