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 / manoj

This can be done using two SORTs in a JCL.
1. In the first SORT, sort the file and create two output
files.
File 1: Containing records from 1 to 7
File 2: Containing records 9 & 10

//SYSIN DD*
SORT FIELDS=COPY
OUTFIL FILES=01,ENDREC=07
OUTFIL FILES=02,STARTREC=09,ENDREC=10
/*

2. Use another SORT statement and then merge the two
statements created above.

Is This Answer Correct ?    13 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the function of //cntl statement?

642


Explain the function of job statement in jcl?

636


How can the disposition of sysout datasets be set for an entire jobstream?

830


How can values be passed from the job stream to an executable program?

864


What do you understand by the term notcat 2 – gs?

741






How can a jobs execution priority be modified?

788


Where & How Do You Code Identifier In Jcl?

688


I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?

686


Name a few IBM utility programs, and explain its function.

4424


Explain the purpose of the dd keylen parameter?

661


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

728


What is the motivation behind coding class parameter in job statement?

674


Can anybody tell what is tool used to generate the list of PROCS used in JCL to generate a PROCTREE

1955


what operation is performed by job statement?

651


What is the significance of addrspc parameter in exec statement?

724