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 is jcl in mainframe?
What is the maximum length of a single line of jcl?
Explain the function of the steplib dd statement?
What is timing concept in mainframe?
What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?
i want to store 20 digits . how will u do it in cobol ?
Are there any set of rules for the names of the steps used in a job? What are they?
How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
What are the utility programs in jcl?
Can we use DISP=SHR in output file in JCL
what is DSN parameter and DISP parameter is used for?
What is the difference between run mode and addressing mode?
How can a stopped job be started again?
How to execute 2nd and 4th steps among 5 steps in jcl proc?
what is the purpose of coding class parameter in job statement?