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
What are some jcl statements that are not allowed in procedures?
Explain the purpose of the dd keylen parameter?
Explain the function of a dd statement?
Explain the function of job statement in jcl?
how to compare two datasets without using superce because output is limited to 133 bytes
How can an in-stream dataset be terminated?
How is the record format of an output dataset specified?
How is a type of file defined in the jcl that executes the cobol program?
What are the parameter we cannot use in procedure?
Is condition checking possible in jcl?
A chkpt is the parameter coded for multi-volume qsam datasets in a dd statement. When a chkpt is coded as chkpt=eov, a checkpoint is written to the dataset specified in the sysckeov statement at the end of each volume of the input/output multi-volume dataset. State whether true or false?
What is the motivation behind coding class parameter in job statement?
What methodology can be adapted to transfer data to a program that is coded using the exec statement?
a set statement is used to define commonly used symbolic across job steps or procedures. It initializes the previous values in the symbolic names. It has to be defined before the first use of the symbolic names in the jcl. State whether true or false?
How can the attributes of one sms dataset be copied to another dataset?