Page 1 of 1

extract detail record using DFSORT

PostPosted: Mon May 24, 2010 1:56 pm
by vidhya gokulkumar
Hi,
I have a file containing header, detail and trailer record. I want to extract header in one file, detail in one file and trailer in one file.
I have extracted header and trailer. But i'm nt sure how to extract detail record alone. We dont use ICETOOL utlity. Pls help with SORT.
my file is like this.

000000hdr data000
12345678
56990000
8899900
000000trl data


Note:
For extracting header and trailer, sort card that i used is:
OPTION COPY
OUTFIL REMOVECC,NODETAIL,HEADER1=(1,80),
FNAMES=SORTOF1
OUTFIL REMOVECC,NODETAIL,TRAILER1=(1,80),
FNAMES=SORTOF2

Re: extract detail record using DFSORT

PostPosted: Mon May 24, 2010 9:13 pm
by skolusu
Vidhya Gokulkumar,

Use the following DFSORT JCL

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                     
000000HDR DATA000                                   
12345678                                             
56990000                                             
8899900                                             
000000TRL DATA                                       
//HDR      DD SYSOUT=*                               
//DTL      DD SYSOUT=*                               
//TRL      DD SYSOUT=*                               
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  OUTFIL FNAMES=HDR,REMOVECC,NODETAIL,HEADER1=(1,80)
  OUTFIL FNAMES=DTL,OMIT=(1,6,ZD,EQ,0)               
  OUTFIL FNAMES=TRL,REMOVECC,NODETAIL,TRAILER1=(1,80)
//*