I tried to search the existing topics and couldn't find a solution for my problem, and that is the reason for posting this as a new topic.
Please let me know the link if the topic is already existing/discussed.
I have below requirement -
If the key is a particluar value in the input file of record length 80, the field from 70 to 72 (3 characters) should have value 100. Next time when the same key comes, the field should be updated with 101. The third time when the key comes it should be 100. So the records having a prticular key should have 100 or 101 at position 70 alternatively.
I am confused how to know what was the last value overlayed (100 or 101) so that I can overlay the other for current record.
For example -
Input file (fixed length)
ABC ------------- XXX
XYZ --------------XXX
CVF --------------XXX
ABC ------------- XXX
XYZ --------------XXX
CVF --------------XXX
XYZ --------------XXX
ABC ------------- XXX
CVF --------------XXX
ABC ------------- XXX
ABC ------------- XXX
XYZ --------------XXX
CVF --------------XXX
ABC ------------- XXX
XYZ --------------XXX
CVF --------------XXX
XYZ --------------XXX
ABC ------------- XXX
CVF --------------XXX
ABC ------------- XXX
ABC ------------- XXX
Output file (fixed length)
ABC ------------- 100
XYZ --------------XXX
CVF --------------XXX
ABC ------------- 101
XYZ --------------XXX
CVF --------------XXX
XYZ --------------XXX
ABC ------------- 100
CVF --------------XXX
ABC ------------- 101
ABC ------------- 100
XYZ --------------XXX
CVF --------------XXX
ABC ------------- 101
XYZ --------------XXX
CVF --------------XXX
XYZ --------------XXX
ABC ------------- 100
CVF --------------XXX
ABC ------------- 101
ABC ------------- 100
Please help.
Thanks in Advance !!
Jyothi