if the value at the position 9 is same for consecutive records, the value at position 1 (which is '1') should be changed to '2' for the second record onwards
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
In your expected output, why do you show the 4th record with a '1' instead of a '2'? Records 2-5 have a 'C' in position 9, so records 3-5 should have a '2' in position 1 - right?
According to your description, the expected output should be:
If that's what you want, then here's a DFSORT job that will do it. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.