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

Why block size is multiple of lrecl in jcl?

915


if the submitter of a job wants to inform another user about the job completion, how can it be done?

756


whats the diff bw the evaluate also and and?

1857


Explain the jcl exec statement?

649


What is the purpose of dd?

728






Are there any set of rules for the names of the steps used in a job? What are they?

614


I have a job called careerride and some steps in it as step1,step2. But I want to execute step2 before step1 ? How do I do that?

833


Explain the purpose of dd * statement in jcl?

643


What are hierarchy levels in jcl?

958


what is DD statement is used in JCL?

683


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

711


What is the purpose of dd dummy statement?

944


which utility is used a dummy utility?

795


In job processing, what happens in conversion stage?

743


How can unused space allocation be returned to the system when a dataset is closed?

812