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

FOR a GDG, the book by 'SABA ZAMEER' says 'We can NOT ALTER the LIMIT parameter after it is defined'. (p-211). But many persons have written that it can be changed, which one is true ?

4 Answers   IBM,


In order to continue a job after a return code of 12 in step1, what the step2 exec statement include?

1 Answers  


what is use of space parameter in dd statement?

0 Answers   IBM,


What parameter of the job statement is used to limit the cpu time consumed by the job?

0 Answers  


if in a job, region is mentioned in both jobcard and in step then which is cosidered at the step level? A job has region 4k in jobcard and step1 with region 0k and step2 with 16k, then what is the region allocated for the entire job? what is the region step1 takes? what is the region step2 takes?

4 Answers  






wt will happen to the step of a job if u code COND=ONLY

5 Answers   ADP,


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:

0 Answers   Keane India Ltd,


what is the function of iebcompr?....is it compare record length or characteristics of a dataset?...pls explain with examples.......

2 Answers  


How can a job send a status message to a tso user at the completion of a job?

1 Answers  


How to get cursor position from system in CICS environment ?

8 Answers  


Using DELETE what type of file can you delete? a)SEQUENTIAL FILE B)INDEXED FILE C) D) Some options were there..i cant remember

3 Answers   HSBC,


I have a File that has duplicate records. I need only those records that occur more than thrice.

3 Answers  


Categories