Page 1 of 1

HEADER3 usage in DFSORT

PostPosted: Tue Dec 02, 2014 7:58 pm
by PREM_G
Hi,
First time I have registered to this forum .My "hai" to all .Below is my question .
I would like to know the dfsort card for header3 usage for below situation
My requirement
INPUT FILE :
A000110000
A000110000
A000110000
C000120000
C000120000
B000130000
B000130000
B000130000
B000130000
B000130000

O/P FILE SHOULD BE LIKE THIS
A000130000
A000110000
A000110000
B0001150000
B000130000
B000130000
B000130000
B000130000
C000140000
C000120000
which MEANS ,I need to total the record amounts based on Key (a0001,b0001,c0001) and put the Total on the first record (header record) of the corresponding key .I tried below sort card .Actually I am not sure how it works I used google to write this .Kindly correct the below sort card .Thanks a lot in advance .
SORT FIELDS=(1,5,A),FORMAT=CH
OUTFIL FNAMES=SORTOUT,
SECTIONS=(1,5,SKIP=P,
HEADER3=(6:TOTAL=(6,5,ZD,M5,LENGTH=10)))

Prem