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
hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u
Is it possible to left uncode disp?
What is the motivation behind coding class parameter in job statement?
When space is allocated for an output dataset, what units can be used?
Explain the function of dd disp parameter?
How to submit a jcl from cics?
If a (+1) generation dataset is created in the first step of a job, how can it be referenced in later steps of the same job for input?
how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?
What is jcl in mainframe, and how many types of jcl statements are there for a job?
can any one plzzzzzz tell the jcl code for creating ps using idcams
how would you create a temporary dataset? And where will you use them?
What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?
what is use of space parameter in dd statement?
How to override loadlib?
What are the parameter we cannot use in procedure?