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


Please Help Members By Posting Answers For Below Questions

Name what parameter directs the output of the job log dataset?

557


What is multithreading in jcl?

937


A dd statement consists of 4 fields. Name them?

921


how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?

778


I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?

692






Is automatic restart possible in jcl? If yes, how?

653


How to execute 2nd and 4th steps among 5 steps in jcl proc?

747


what is use of space parameter in dd statement?

750


What statement can be used to send data to another mvs jes3 node?

821


by using cond parameter maximum 8 cond can be coded in single cond means ?explain

969


How can the submitting users racf authority be overridden in a job stream?

741


What is the difference between the positional and keyword parameters? Give examples.

702


Explain the purpose of dd * statement in jcl?

633


How to pass data to a program that is coded in an exec statement?

818


Brief description of inline procedure of jcl.

680