Thanks Dick,
I will take care of code tab and I will use preview option before submitting:
I will give u sample which is different then the example given above
Input file with recfm=fb lrcel=20:
And fields are:
1rdfi_no bank_name --> First digit 1 indicates file Header rec
5bank_id Mics_reco --> First digit 5 indicates batch header rec
6trno Accnt_no amt --> First digit 5 indicates detail rec
The
Input file records are:
12343454 BANK_Name
5sd34245 rec
62345 12345678 345
62345 12345678 345
62345 12345678 345
62445 12343658 355
5er32345 rec
62446 12343653 455
62446 32342653 555
62446 12343653 455
Output:
1)
Unique Record file with recfm=fb,lrecl=40
rdfi_no, bank_id, trno, Accnt_no, amt
2343454, sd34245, 23, 12345678, 345
2343454, sd34245, 24, 12343658, 355
2343454, er32345, 24, 12343653, 455
2343454, er32345, 24, 32342653, 555
2)
Duplicate record file with rcfm=fb,lrecl=40
rdfi_no, bank_id, trno, Accnt_no, amt
2343454, sd34245, 23, 12345678, 345
2343454, sd34245, 23, 12345678, 345
2343454, er32345, 24, 12343653, 455
The rules to get this result are:
1)plug rdfi_no and bank_id from file header and batch header to detail record.
2)find duplicates after above step(every field must match e.g. full lrecl).
3)create two file one is having only single entry records and other is having only duplicates from second occurance e.g. if input file has a record occured 4 times then write one entry to unique record file and write 3 times to other file.
Approach given by me:
step 1:
Create an intermediate file using cobol internal sort and then release only duplicate record to output file and write all other records to unique record file but its not possible so I prepared intermedeate file using a simple cobol code which looks like:
rdfi_no, bank_id, trno, Accnt_no, amt
2343454, sd34245, 23, 12345678, 345
2343454, sd34245, 23, 12345678, 345
2343454, sd34245, 23, 12345678, 345
2343454, sd34245, 24, 12343658, 355
2343454, er32345, 24, 12343653, 455
2343454, er32345, 24, 32342653, 555
2343454, er32345, 24, 12343653, 455
step2: trying to create output files shown above
1)Unique Record file 2)duplicate Record file --> In this step I am stuck to create these two files because in my shop xsum is not working and in icetool there is no option to separate duplicates from second occurance.
Thanks for all your kind help.