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 / muttiah
I'm not sure about the answers posted.But you can try this
simple JCL to achieve what you want.
//JOBCARD /*As per your company standard*/
//STEP1 EXEC PGM=SORT
//Sortin DD DSN=<Inputfile>,disp=shr
//SORT0F01 DD DSN=<FILENM1>,DISP=OLD
//SORT0F02 DD DSN=<FILENM2>,DISP=OLD
//SORT0F03 DD DSN=<FILENM3>,DISP=OLD
//SORT0F04 DD DSN=<FILENM4>,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY OR SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=1,ENDREC=1
OUTFIL FILES=02,STARTREC=2,ENDREC=2
OUTFIL FILES=03,STARTREC=3,ENDREC=3
OUTFIL FILES=04,STARTREC=4,ENDREC=4
/*
//
NOTE: I have given DISP=OLD which means it will override
the contents when you submit the jcl
If you want to create a new dataset replace like this
EX:
//SORT0F04 DD DSN=<FILENM4>,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,4)),DCB=*.SORTIN
Hope this makes sense!!
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can a stopped job be started again?
Is it possible to left uncode disp? If yes, how?
Is their any set of rules for dd? Explain.
what disp parameter we mention for creation of temporary dataset so that we can use it in later steps?
How to alter the parameters for the existing gdg?
Explain the jcl exec statement?
What are the 4 fields in dd statement?
what is use of disp parameter in dd statement?
Explain how can the disposition of sysout datasets be set for an entire jobstream?
what is DD statement is used in JCL?
what is DSN parameter and DISP parameter is used for?
We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?
What is the use of disp parameter?
Explain dfsort utility?
I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?