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

How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you

597


What are s0c1, s0c4, s0c5, s0c7 and socb?

692


Give the syntax of job specifying jcl statement.

628


I need exexution process for JCL programs

1842


I have 60 steps in the JCL and want to Execute Only First from PROC by overriding in JCL ?

1339






define cond parameter in jcl?

763


What is job control language?

603


What are the 2 types of parameters in dd statement?

637


Explain the function of dd name parameter with a 2 part structure; audit.report?

885


what is use of dsn parameter in dd statement?

662


What does a disposition of (new,catlg,keep) for a dsn mean?

602


Name the statement which can be used to send data to another mvs jes3 node?

593


What is the use of disp parameter?

643


What is the function of the dd mgmtclas keyword in sms datasets?

728


What does a disposition of (MOD,DELETE,DELETE) mean ?

658