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

How is a type of file defined in the jcl that executes the cobol program?

706


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?

608


When output dataset space is required, what quantity categories are used?

821


Explain the jcl exec statement?

644


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.

1947






What are steplib and joblib?

719


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

919


what is use of dcb parameter in dd statement?

769


In job processing, what happens in execution stage?

696


How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?

667


What is the significance of addrspc parameter in exec statement?

724


What is the function of a dd statement?

702


What are the parameters that are used in creating a gdg?

735


Explain the function of job statement in jcl?

644


Explain how can the disposition of sysout datasets be set for an entire jobstream?

632