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

Answers were Sorted based on User's Feedback



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

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

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

Answer / mahesh

//step1 exec pgm=iebgener
//sysut1 dd dsn=fss149.mahesh.ps1,disp=(shr)
//sysut2 dd dsn=fss149.mahesh.ps2,disp=shr

Is This Answer Correct ?    2 Yes 23 No

Post New Answer

More JCL Interview Questions

What methodology can be adapted to transfer data to a program that is coded using the exec statement?

0 Answers  


What is the purpose of disp parameter?

0 Answers  


How to alter the parameters for the existing gdg?

0 Answers  


What is the difference between a PDS member and a GDG Generation ? Is it only this, that with a generation we can use +1, 0, -1 etc while with PDS member we can not ?

7 Answers   IBM,


In job processing, what happens in execution stage?

0 Answers  






Hi Please try to be to-the-point. 1) How to INCLUDE a JCL segment in a JOB ? (A Small example) 2) What is SPOOL and what is SPOOL FULL ? and how to direct the output of a Jobstep to SPOOL ?

3 Answers   IBM,


why do we use file-aid wht r the adv of using file-aid thn in ispf

7 Answers   HCL, Tech Mahindra,


what is mainframe?

4 Answers   CGI,


What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?

2 Answers  


How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?

0 Answers  


Describe the JOB statement, its meaning, syntax and significant keywords?

1 Answers  


describe the dd statement,its meaning,syntax and keywords?

1 Answers  


Categories