My requirement is I have a file of lrecl 81.The adjacent records have to be compared.i.e if the first record has '>>'in pos '1' and the second record
has 'null' in pos '2' we have to append the second record with the sequence number.then for 2nd and 3rd record.Thus the check has to be repeated for the entire file..
Can we do this in SORT or I have to choose COBOL?
If the first record has Â» and the second record has null in the 2nd pos the
first record wil be deleted and the second record will be appended with the
sequence number and '1' will be appended with 8 spaces.If the condition is not satisfied then only the sequence number will be appended. Do you need any further information?
I put in code tags to get the input closer to what you wanted it to look like but I don't know if I got the alignment of fields correct.
What do you mean by null? X'00' or something else?
'1' will be appended with 8 spaces
I don't understand what you mean by this. You deleted record 0 and added sequence number 000000 followed by a '1'. But you deleted record 4 and added sequence number 000003 but did not follow that with a '1'. Why the difference? And what about the 8 spaces? Are 000001! and 000002! supposed to start in different positions?
Perhaps a few more examples of >> records for input and the resulting output would help.