Hello,
I have a requirement. I have two files having the data as below:
File 1 -
A 02------------------
A 02-----------------
A 01--------
A 03000000002
B 02------------------
B 02-----------------
B 02-----------------
B 01--------
B 03000000003
C 02------------------
C 02-----------------
C 02------------------
C 02-----------------
C 02------------------
C 02-----------------
C 01--------
C 03000000006
D 02------------------
D 01--------
D 03000000001
File 2 -
D 02------------------
D 01--------
D 03000000001
B 02------------------
B 02-----------------
B 02-----------------
B 01--------
B 03000000003
F 02------------------
F 01--------
F 03000000001
here 02 is detail record, 01 is header record, 03 is trailer record
I want use DFSORT / ICETOOL to sort and sum in such a way that -
1) Merge the two files in a single file
2) The header can be used from file 1, if particular record are absent (e.g. F) in file 1 then use the header from file 2
3) From the merged file, put the total count of records for each type (e.g.A, B, C, D, F etc.) in trailer
Please let me know, how this can be done.
Thank you in advance for your help.
Thanks,
Yogi