
The title is simplistic for what this post is really about. The question that was asked was:
I have a character field in a DDS physical file that is 20 characters long. There can be various numbers in that field of any length. I want to retrieve the value from the field, increment it by one, and update the field in the file.
If all the "numbers" in the field in the file were 20 characters long it would be easy, but as the "numbers" can be of different lengths it makes the problem more interesting.
First I need a file for this 20 character field. I decided to call it TESTFILE and the DDS code for it is:
01 A UNIQUE 02 A R TESTFILER 03 A KEY 5A 04 A FIELD1 20A 05 A K KEY |