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


Please Help Members By Posting Answers For Below Questions

Explain how can values be passed from the job stream to an executable program?

613


what is the difference between JES3 and JES2?

676


How is the record format of an output dataset specified?

743


Explain the function of dd name parameter with a 2 part structure; audit.report?

890


Explain the job statement in jcl?

642






Which dd parameters are required?

685


Name a few IBM utility programs, and explain its function.

4428


How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.

5058


When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?

928


how do you access an uncataloged dataset in a jcl?

827


Must tape dataset definitions include vol=ser specifications?

971


For what purpose steplib and joblib are used ?

682


How can a stopped job be started again?

707


What are the 4 fields in dd statement?

737


Immediate Job opening for mainframe professionals in Keane Bangalore. Please find the below details: Organization: Keane India Location: Bangalore Skill: COBOL, JCL,VSAM,DB2,CICS,IMS,REXX,CLIST Exp: 1 to 4 years only Employment Type: Permenant Employee Note: If you have attended keane interview in past 6 months please ignore this job opening. Please respond to email id keanemfjob@gmail.com OR keanemfjob@yahoo.in with your latest resume and following details, We will contact you within 24 hours: Total IT Exp: Exp in Mainframe: Current CTC: Expected CTC: Notice Period:

3527