On Fri, Dec 4, 2015 at 5:38 PM, Stone, Joel <Joel.Stone@xxxxxxxxxx> wrote:
I have a length 4 alphanum field which I need to find the next value (incremented by one value).

To be precise, you need to say what all the possible values are for a
given byte. (For example, maybe you can use any of the 256 binary
values. Or maybe you can use anything printable. Or maybe just upper-
and lowercase characters, plus digits.) Your examples suggest that you
are working with uppercase letters and the ten decimal digits, for a
total of 36 possible values.

And my shop would like it done in COBOL, but any algorithm will suffice.

Maybe use a base 36 table???

You certainly could. Your problem is essentially the same as one
raised in this mailing list in June 2015 by Gad Miron. The thread
starts here:


You could also search for "The case of outnumbered numerator". Gad
eventually wound up adapting the code provided by Sam L later in that


John Y.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].