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?



Suppose your program is reading a Sequential Vsam file. The file contains 10 records. How will you..

Answer / 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

More JCL Interview Questions

Explain the job statement in jcl?

0 Answers  


What is the difference between catalogue procedure and In-Stream procedure?

2 Answers  


how would you create a temporary dataset? And where will you use them?

0 Answers  


Suppose I have five jobs to do. But I want to hold one?

0 Answers  


How can return codes be tested before execution of a job step?

0 Answers  






describe the job statement, its meaning,syntax and significant keywords?

1 Answers  


Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT COUNT(1)?

8 Answers  


Explain about LMMLIST�list a library's members

1 Answers  


a job have 5 steps and it will executes a proc which have 5steps in it. now i have to execute step3 only when step2 of proc executes successfully

3 Answers  


How can you execute a COBOL program via SYSIN in JCL?

1 Answers  


how to write a jcl prog to copy alternate recs from ps1 to another ps2,suppose ps1 having 10 recs?

2 Answers   Steria, TCS,


wht happens if blksize = 0 and lrec = 0 ?

1 Answers   TCS,


Categories