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 how can the disposition of sysout datasets be set for an entire jobstream?
I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?
Is automatic restart possible in jcl?
Is it possible to define dd statements as you want?
Explain how can a jobs execution priority be modified?
I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one
How is the record format of an output dataset specified?
What parameter of the job statement is used to limit the cpu time consumed by the job?
What are s0c1, s0c4, s0c5, s0c7 and socb?
How can a fb file convert to vb file using sort program?
I have 60 steps in the JCL and want to Execute Only First from PROC by overriding in JCL ?
List the different jcl statements that are not permitted in the procedures?
how do you access an uncataloged dataset in a jcl?
If a (+1) generation dataset is created in the first step of a job, how can it be referenced in later steps of the same job for input?
WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375