Monday, September 26, 2011

Sort to different output files

 I have a input file which I want to sort and put it in 2 output files. I want this in  a single step using sort.


Here is an example:

//STEP010 EXEC PGM=SORT                             
//SYSUDUMP  DD SYSOUT=*                             
//SYSOUT    DD SYSOUT=*                             
//SORTIN   DD  DSN=INPUT.XXXX.SOMETHING.KSDF,   
//             DISP=SHR                             
//SORTOF1   DD DSN=userid.TSTS.XXXX.HEADER,        
//             DISP=(NEW,CATLG,DELETE),             
//             DCB=(LRECL=270,RECFM=FB),            
//             SPACE=(CYL,(50,50),RLSE)             
//SORTOF2   DD DSN=userid.TSTS.XXXX.COMPLETE,        
//             DISP=(NEW,CATLG,DELETE),             
//             DCB=(LRECL=270,RECFM=FB),            
//             SPACE=(CYL,(50,50),RLSE)             
//SYSIN     DD *                                    
SORT FIELDS=COPY                                   
OUTFIL FILES=1,INCLUDE=(6,2,CH,EQ,C'01') ==> Copies based on condition...
OUTFIL FILES=2   ========> Simply copies
/*                   

(Alternately, instead of FILES=1, you could also use FNAMES=TEMP1 and use
that DDNAME - TEMP1 - instead of SORTOF1)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.