Suppose your program is reading a Sequential Vsam file. The
file contains 10 records. How will you code the JCL to read
only 2nd, 5th, 7th,and 10th record?
Answer Posted / mahesh
Hope this will work
//SORTIN DD DSN=INPUTFILE,DISP=SHR
//SORTOF01 DD DSN=X.Y.OUTFILE1,DISP=SHR
//SORTOF02 DD DSN=X.Y.OUTFILE2,DISP=SHR
//SORTOF03 DD DSN=X.Y.OUTFILE3,DISP=SHR
//SORTOF04 DD DSN=X.Y.OUTFILE4,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=2,ENDREC=2
OUTFIL FILES=02,STARTREC=5,ENDREC=5
OUTFIL FILES=03,STARTREC=7,ENDREC=7
OUTFIL FILES=04,STARTREC=10,ENDREC=10
/*
//STEP2 EXEC PGM=SORT
//SORTIN DD DSN=X.Y.OUTFILE1,DISP=SHR
// DD DSN=X.Y.OUTFILE2,DISP=SHR
// DD DSN=X.Y.OUTFILE3,DISP=SHR
// DD DSN=X.Y.OUTFILE4,DISP=SHR
//SORTOUT DD DSN=X.Y.OUTFILE,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
Use X.Y.OUTFILE as input to your program , but in real time
it wont make sense
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
what is the resolution for sb37 error
Name what parameter directs the output of the job log dataset?
What is Cataloged Procedures?
Explain the hierarchy levels in jcl?
Explain about ISPF/TSO Commands
In job processing, what happens in conversion stage?
how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?
Explain how can the disposition of sysout datasets be set for an entire jobstream?
How can the disposition of sysout datasets be set for an entire jobstream?
How to run cobol program using jcl?
In sms datasets, what is the function of the dd mgmtclas keyword?
Where can program checkpoints be stored for use in a restart?
How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you
What is the format of comment statement?
What do you know about jcl?