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

What is the use of symbol // in jcl?

935


Explain the function of the steplib dd statement?

654


How do you overcome this limitation ?

703


what are the types of abends that occur on job failure? And explain the possible causes of these

1126


WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375

1046






How does the jcl specify the job to os?

701


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

1770


Is it possible to define dd statements as you want?

651


How jcl work to handle various input output file operations?

663


Can an individual step be restricted from using all the jobs allowed cpu time?

1018


What is the function of //jcllib statement?

814


Explain the purpose of dd dummy statement?

678


define cond parameter in jcl?

780


How do you access an uncatalogued dataset in a jcl?

735


What are the parameters that are used in creating a gdg?

745