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
Explain the function of a dd statement?
Explain the hierarchy levels in jcl?
How does jcl act on code(if you take a cobol program)?
What do you know about jcl?
what is the purpose of coding notify parameter in job statement?
What is the function of a dd statement?
Differentiate between the joblib and the steplib statements?
How to pass the parameter in parm using linkage section ? (syntax)?
Is it possible to code instream data in a PROC?
When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?
What are the parameter we cannot use in procedure? How many instream we can write in single jcl?
What are the 2 types of parameters in dd statement?
What are the jcl procedures?
Can we call instream to catalog and catalog to instream?
//S10 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //CON DD DSN=VAR.INPUT1,DISP=SHR // DD DSN=VAR.INPUT2,DISP=SHR //OUT DD DSN=VAR.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,5)),UNIT=SYSDA //TOOLIN DD * * Splice the needed data from the two VB files together SPLICE FROM(CON) TO(OUT) ON(5,5,CH) WITHALL - WITH(12,5) WITH(22,20) VLENMAX /*