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


Please Help Members By Posting Answers For Below Questions

What happens if both JOBLIB & STEPLIB is specified ?

612


What is the difference between run mode and addressing mode?

635


what is the difference between JES3 and JES2?

681


Can an individual step be restricted from using all the jobs allowed cpu time?

1009


What are the 4 fields in dd statement?

744






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

713


How can a fb file convert to vb file using sort program?

807


Must tape dataset definitions include vol=ser specifications?

981


by using cond parameter maximum 8 cond can be coded in single cond means ?explain

977


if the submitter of a job wants to inform another user about the job completion, how can it be done?

756


What dd statement is used to supply the name of a dataset?

779


Name the statement which can be used to send data to another mvs jes3 node?

604


Explain the function of the dd dcb keyword?

706


I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?

704


What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?

816