how to write a jcl prog to copy alternate recs from ps1 to
another ps2,suppose ps1 having 10 recs?
Answer Posted / vaneesh khurana
To do so we require OUTFIL and SPLIT option of DFSORT.
//STEPNAME EXEC PGM=SORT
//SORTIN DD DSN=SORTIN.INPUT.FILE.TO.SPLIT,DISP=SHR
//PS1 DD DSN=PS1.FILE,DISP=SHR
//PS2 DD DSN=PS2.FILE,DISP=SHR
//SYSIN DD *
OUTFIL FNAMES=(PS1,PS2),SPLIT
/*
This will write 1st, 3rd,5th ....record in the PS1 and
2nd,4th,6th ....record in ps2 file.
Is This Answer Correct ? | 14 Yes | 3 No |
Post New Answer View All Answers
What is the purpose of dd?
What are the parameters that are used in creating a gdg?
Is automatic restart possible in jcl? If yes, how?
How do you overcome this limitation ?
Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed
What is the function of dd name parameter with a 2 part structure; audit.report?
What is condition checking in jcl? Is this possible?
What are hierarchy levels in jcl?
when can a job time-out occur? How to overcome that?
what is DSN in JCL and what are the parameters to declare the DSN?
What do we mean by 'Virtual storage' for a dataset and for a JOBSTEP ? What is the significance of the following statement for a programmer 'Virtual storage results in program addresses being independent of the addresses that actually exist in a computer' ?
What is the function of dd disp parameter?
How can unused space allocation be returned to the system when a dataset is closed?
Suppose there are 2 Input files Infile-1 and Infile-2. Both the Files contain Employee Records. You need to compare both the files and Write the Common Records in third file named Outfile. How can we do this using File-Aid?
In job processing, what happens in execution stage?