Hi,
I have a requirement where i need to copy the records from input file onto the output file depending upon two strings..
Eg:
Sample Input file.
11111AAAA
22222BBBB
33333CCCC
44444DDDD
55555EEEE
66666FFFF
77777BBBB
88888FFFF
REQUIREMENT: Start copying the contents of the input file starting from the record which contains 'BBBB' at column 6 till it encounters 'FFFF'.
Sample output file
22222BBBB
33333CCCC
44444DDDD
55555EEEE
Points to note:
1) 'BBBB' is inclusive the record needs to be included in the input file, however the 'FFFF' has to be exclusive, it needs to be excluded from the output file.
2) Match should happen only once mean to say it should not consider the second set of conditions
77777BBBB
88888FFFF
3) Both input and output files are FB, PS, LRECL 80.
I need this requirement to be achieved using SORT. SKIP and STOPAFT works on the record count however my requirement is on the text string and i dont have a clue where these strings might be present in the input file at runtime.
Any help would be much appreciated.
Cheers..