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

a dd statement has 2 types of parameters. Name them?

653


How to do automated restart when a job abend?

791


what is the use of IEBGENER utility?

662


what is a jcl?

691


What are the 2 types of parameters in dd statement?

652






What does a disposition of (new,catlg,keep) for a dsn mean?

618


Explain the job statement in jcl?

653


Can anybody tell what is tool used to generate the list of PROCS used in JCL to generate a PROCTREE

1971


what is use of disp parameter in dd statement?

667


What is the difference between run mode and addressing mode?

638


What are steplib and joblib?

725


I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPRO 3 WIPRO 2 WIPRO 9 TCS 4 TCS 6 TCS 3 i want the record of every company with highest code How can i do that?

8690


How to run cobol program using jcl?

655


which parameter is used to check the syntax of a jcl without executing it?

801


which utility is used to sort a file in jcl?

750