020081003ABB --> header record
1KLBB456TY
1KLAA787NN
1KLBB456TY
9000005 --> trailer record
The records starting with 1 are daterecords. The doubles should be sorted out and the number '000005' in the trailer record should be adjusted. So after the sort the file looks like this
020081003ABB --> header record
1KLBB456TY
1KLAA787NN
9000004 --> trailer record
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
OUTREC IFOUTLEN=80, <<< preserves the original input file lrecl
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,6,ZD)), <<< writes as 6 byte seqnum at pos 81 which acts like record counter after sort has eliminated the duplicate records
IFTHEN=(WHEN=(1,1,ZD,EQ,9),OVERLAY=(2:81,6)) <<< if it is trailer record, overlay the record counter value at pos 81 on to pos 2
It adds a 6-byte sequence number after the end of each sorted/summed record ('000001', '000002', etc). The sequence number in the last record (trailer record) will be equal to the count of output records (e.g. if there's a header record, two detail records and a trailer record, the trailer record will have a sequence number of '000004'). The last sequence number = count is overlayed into the trailer ('9') record. IFOUTLEN=80 sets the length of the output records to 80.
thanks for the examples and explanation
all the examples use iceman and icetool
whta possibilities they have
I am working in a bank. We are using the old DFSORT I believe
Tomorrow I will have a look, try out and let you know
thanks
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Do you mean you want the records eliminated by SUM in a different output file? Or do you mean something else? For your original example, would you just want the other output file to have the second 1KLBB456TY record, or would you want it to have something else? If something else, what?
yes you are right
I want the records eliminated by SUM in a different output file. So for the original example, I want the other output file to have the second 1KLBB456TY record