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 / priyanka
//**********************************************************
//STEP0011 EXEC
PGM=SORT
//SORTIN DD DSN= <input file>
//
DISP=SHR
//SORTOFO1 DD DSN= <output file 1>,
// DISP=
(NEW,CATLG,DELETE),
// SPACE=(CYL,
(10,10),RLSE)
//SORTOFO2 DD DSN= <output file 2>,
// DISP=
(NEW,CATLG,DELETE),
// SPACE=(CYL,
(10,10),RLSE)
//SORTOFO3 DD DSN= <output file 3>,
// DISP=
(NEW,CATLG,DELETE),
// SPACE=(CYL,
(10,10),RLSE)
//SORTOFO4 DD DSN= <output file 4>,
// DISP=
(NEW,CATLG,DELETE),
// SPACE=(CYL,
(10,10),RLSE)
//*
//SORTWK01 DD SPACE=(CYL,
(100,50)),UNIT=SYSDA
//SORTWK02 DD SPACE=(CYL,
(100,50)),UNIT=SYSDA
//SYSOUT DD
SYSOUT=*
//SYSIN DD
*
SORT FIELDS=
(01,3,CH,A)
OUTFIL FILES=O1,INCLUDE=
(01,3,CH,EQ,C'USA'),CONVERT,OUTREC=(4,062)
OUTFIL FILES=O2,INCLUDE=
(01,3,CH,EQ,C'CAN'),CONVERT,OUTREC=(4,062)
OUTFIL FILES=O3,INCLUDE=
(01,3,CH,EQ,C'CHE'),CONVERT,OUTREC=(4,062)
OUTFIL FILES=O4,INCLUDE=
(01,3,CH,EQ,C'GBR'),CONVERT,OUTREC=(4,062)
/*
//**********************************************************
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What happens if both JOBLIB & STEPLIB is specified ?
What is the difference between run mode and addressing mode?
what is the difference between JES3 and JES2?
Can an individual step be restricted from using all the jobs allowed cpu time?
What are the 4 fields in dd statement?
How is a type of file defined in the jcl that executes the cobol program?
How can a fb file convert to vb file using sort program?
Must tape dataset definitions include vol=ser specifications?
by using cond parameter maximum 8 cond can be coded in single cond means ?explain
if the submitter of a job wants to inform another user about the job completion, how can it be done?
What dd statement is used to supply the name of a dataset?
Name the statement which can be used to send data to another mvs jes3 node?
Explain the function of the dd dcb keyword?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?
What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?