× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Joel,

Your example shows A-Z, 0-9.
I would use 0-9, A-Z.

I would:
- convert from base 36 to base 10
- increment by 1
- convert from base 10 to base 36

A 4 char field with base 36 will range from 0 to 1679615 in base 10.
You'll have to code something that will restart at 1 when trying to
increment past 1679615.


Yours truly,

Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Work: (416) 675-9200 ext. 89224
Cell: (416) 317-3144


On 4 December 2015 at 17:38, 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).

Examples:

A001 => A002


BBBB => BBBC


WXYZ => WXZ0



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

Maybe use a base 36 table???

SQL?

RPG?

Thanks in advance.



______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs
Skyscan service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.