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

What do you understand by jcl?

714


What is the syntax of JCL statement?

788


For what purpose steplib and joblib are used ?

761


what is DSN in JCL and what are the parameters to declare the DSN?

823


What is the purpose of dd dummy statement?

1044






how JCL works?

883


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?

706


Describe the various parameters utilized in the creation of a gdg?

777


Is acct parameter mandatory?

844


I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?

823


How would you understand error(execution phase)?

723


what is the JCL statement consists of?

792


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

1222


Explain the jcl exec statement?

746


write a jcl to execute a job by 7:00 am on jan 20,1986?

780