Hi there
Can you help me or suggest ways to tackle another problem I have.
I need to create a single output file from 3 files.
They all are FB 100 bytes records, and I need to retain the sequence on output.
Checking File 1 and File 2, I need to ignore duplicates.
But, if details exist on File 3 in either File 1 or File 2 then I need to ignore it completely.
One problem is that the records on File 1, 2 and 3 are grouped into a Header and numerous data records.
Also, there isn't any guarantee that the number of data records matches between files, ie 2 could be on File A but only one data record on File 2.
I started looking at various ways to achieve this but faioled when it came to removing duplicates with Grouped records.
For all 3 files:-
The header record starts 'K' in col 1; the key is 18 long and starts in col 8
The data record starts 'D' in col 1, some may or may not have a date following
e.g.
File1
K000001AAAAAAAAAAAAAAAAAA etc, etc
D14-11-2001A111 etc, etc
D18-11-2001A111 etc, etc
K000002BBBBBBBBBBBBBBBBBBBB etc, etc
D04-12-2001A788 etc, etc
D Y666 etc, etc
K000003CCCCCCCCCCCCCCCCCC etc, etc
D11-10-2001A345 etc, etc
D08-11-2001A222 etc, etc
K000005EEEEEEEEEEEEEEEEEEEE etc, etc
D11-10-2001A345 etc, etc
D08-11-2001A222 etc, etc
File2
K000002BBBBBBBBBBBBBBBBBBBB etc, etc
D04-12-2001B788 etc, etc
D Y666 etc, etc
K000003CCCCCCCCCCCCCCCCCC etc, etc
D11-10-2001U345 etc, etc
D08-11-2001U222 etc, etc
K000004DDDDDDDDDDDDDDDDDD etc, etc
D11-10-2001H345 etc, etc
D08-11-2001H222 etc, etc
K000005EEEEEEEEEEEEEEEEEEEE etc, etc
D11-10-2001K345 etc, etc
D08-11-2001U222 etc, etc
File3
K000005EEEEEEEEEEEEEEEEEEEE etc, etc
D11-10-2001K345 etc, etc
D08-11-2001U222 etc, etc
Output:-
K000001AAAAAAAAAAAAAAAAAA etc, etc (from FILE 1)
D14-11-2001A111 etc, etc
D18-11-2001A111 etc, etc
K000002BBBBBBBBBBBBBBBBBBBB etc, etc (from FILE 2)
D04-12-2001B788 etc, etc
D Y666 etc, etc
K000003CCCCCCCCCCCCCCCCCC etc, etc (from FILE 2)
D11-10-2001U345 etc, etc
D08-11-2001U222 etc, etc
Any help or pointers will be most appreciated.