Loading

Sort-card to split a file into multiple files (OUTFIL,FNAMES,SAVE)

Let’s say we have a file with first byte having 2 different values ‘A’ or ‘B’ or any other character.
We are going to create a file with all records starting with A (DD name SORTXXA), a second file with all records starting with B (DD name SORTXXB), a third file (DD name SORTXXX) with remaining records.

 SORT FIELDS=COPY
 OUTFIL FNAMES=SORTXXA,INCLUDE=(1,1,CH,EQ,C'A') 
 OUTFIL FNAMES=SORTXXB,INCLUDE=(1,1,CH,EQ,C'B')   
 OUTFIL FNAMES=SORTXXX,SAVE  

Related Posts




blog comments powered by Disqus

There's 0 Comment So Far

Share your thoughts, leave a comment!