My 5 cents...
In my career, I have had to solve some problem like this by tricks as
suggested (using base 16 or 36, mixing letters and numbers, using
alternate collating sequence, splitting data bases, etc... )
This is typically a design problem, and IMHO it can only be addressed by a
design change.. not by a programming trick.
Actually I just believe that this is the wrong way.
In 2015, shouldn't a developer just suggest : ALTER TABLE ... ALTER
COLUMN ... SET DATATYPE CHAR(7)
If the application cannot afford that sort of change in the data base...
the application needs "modernization" or will probably not survive the
next design problem..
My conviction/fear is that if you implement one of the proposed trick
(base 16/36,etc..) the application will die and be totally replaced within
maximum 3-5 years...
Making an application flexible/easy to adapt quickly is what I call
"modernization"
So my recommendation is : Modernize your application before your counter
reaches 999999 and do not invest in programming tricks unless you agree to
decommission your application in 3 years.
Paul
From: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
To: Midrange-L Midrange-l <midrange-l@xxxxxxxxxxxx>
Date: 17/06/2015 21:57
Subject: Re: The case of outnumbered numerator
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
I was suggesting that perhaps going all the way to base 36 was overkill
John and that base 16 might provide a satisfactory, and far easier to
implement, alternative.
My understanding of OPs original request was that he knew 99999? wasn?t
big enough and was wondering about 0-Z as an alternative. I don?t think he
said it was a requirement.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
On Jun 17, 2015, at 1:17 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:
On Wed, Jun 17, 2015 at 12:46 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:
Another option that could be simply implemented using IBM APIs is to us
a hex key. Maintain internally as integer, add 1 and convert to hex for
output.
You expand the space from base 10 to base 16, but OP is looking to
expand to base 36. And to maintain EBCDIC sort order, which your
suggestion doesn't do either.
John Y.
--
As an Amazon Associate we earn from qualifying purchases.