Thursday, February 28, 2013

JCL to stop copying records from one file to another

The Following JCL can be used to Stop the copying of records from input file to output after a specific number of records :-

//JOB CARD
//STEP010  EXEC PGM=SORT                              
//SORTIN   DD DSN=<Input file>, DISP=SHR
//SORTOUT  DD DSN=<OUTPUT FILE>,
//            DISP=SHR
//SYSIN    DD *                                       
  SORT FIELDS=COPY,STOPAFT=50000                      
/*                                                    
//SYSOUT   DD SYSOUT=*                                
//SYSUDUMP DD SYSOUT=*                                
//*                                                   
The above jcl will stop the copying after 50000 records

No comments:

Post a Comment