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

Can we use DISP=SHR in output file in JCL

943


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length ----TRY

853


how do you code a null statement?

763


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

920


I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK

1477






what operation is performed by job statement?

651


How do you overcome this limitation ?

685


Explain the function of job statement in jcl?

636


What is the purpose of dd * statement in jcl?

791


How can a jobs execution priority be modified?

788


Explain dd statement in jcl?

630


What is the significance of addrspc parameter in exec statement?

724


How is a type of file defined in the jcl that executes the cobol program?

701


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?

773


Name the parameters which can be used to limit the number of records written to a sysout dataset?

646