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 / madhu
We can achieve the same easily by using ICETOOL.
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SORT.TEST,DISP=SHR
//SORTOUT DD DSN=SORT.TEST.OUTPUT,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(500,500),RLSE)
//TOOLIN DD *
SUBSET FROM(SORTIN) TO(SORTOUT) INPUT REMOVE RRN(4) RRN(6)
/*
//
Explanation:
SORTIN refer input file with 10 records
SORTOUT is the new file created by excluding 4th and 6th records.
SUBSET,INPUT and REMOVE are defined ones in ICETOOL.
RRN is used to refer the required record .
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
List the various advantages of using jcl language?
What is jcl in mainframe?
Suppose there are 2 Input files Infile-1 and Infile-2. Both the Files contain Employee Records. You need to compare both the files and Write the Common Records in third file named Outfile. How can we do this using File-Aid?
which utility is used to sort a file in jcl?
How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
What is the function of //jcllib statement?
how you can access an uncataloged dataset in a JCL?
How jcl is used for testing batch programs?
How to do automated restart when a job abend?
Explain the hierarchy levels in jcl?
how can you check if a file is empty using jcl?
What do you understand by the terms: joblib and steplib?
Explain dfsort utility?
What do you understand by the term notcat 2 – gs?