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
Can we use DISP=SHR in output file in JCL
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
how do you code a null statement?
When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?
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
what operation is performed by job statement?
How do you overcome this limitation ?
Explain the function of job statement in jcl?
What is the purpose of dd * statement in jcl?
How can a jobs execution priority be modified?
Explain dd statement in jcl?
What is the significance of addrspc parameter in exec statement?
How is a type of file defined in the jcl that executes the cobol program?
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?
Name the parameters which can be used to limit the number of records written to a sysout dataset?