Suppose i have a file with 10 recs and i want to skip only the
7 th record and copy the rest into another file. How do i do
it using SORT?

Answer Posted / shubham_a

I am giving it a try, please correct me if anything is wrong

//JOBNAME JOB `ACCINFO`,MSGCLASS=X
//STEP001 EXEC PGM=DFSORT
//SORTOUT DD DSN=ABC.DEF.GHI
// DISP=(,CTLG)
//SORTIN DD DSN=ABC.EXAMPLE.INFILE,DISP=SHR
//SORTOUT DD DSN=ABC.EXAMPLE.OUTFILE,DISP=(,CATLG,DELETE)
//SORTOF01 DD DSN=ABC.EXAMPLE.OUTFILE,DISP=SHR
//SORTOF02 DD DSN=ABC.EXAMPLE.OUTFILE,DISP=SHR
// DCB=*.SORTIN,SPACE=*.SORTIN
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,STOPAFT=06
OUTFIL FILES=02,SKIPREC=07,STOPAFT=10
/*
//SYSOUT DD SYSOUT=* =COPY
//

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any command to check wether the ps file is in sorted order?

2527


Explain how can the submitting users racf authority be overridden in a job stream?

757


What is Cataloged Procedures?

794


Can we use DISP=SHR in output file in JCL

1069


How to alter the parameters for the existing gdg?

799






What are the difference between jcl and jes?

1146


how you will the direct the data to spool using sysout option?

1927


What are the jcl procedures?

735


what is the resolution for sb37 error

7993


Why block size is multiple of lrecl in jcl?

1021


what JCL Procedures?

799


How do you access an uncatalogued dataset in a jcl?

817


i want to store 20 digits . how will u do it in cobol ?

960


Explain about ISPF/TSO Commands

1438


If a (+1) generation dataset is created in the first step of a job, how can it be referenced in later steps of the same job for input?

888