Incrementing Alphanumeric Fields

Rod Caddy rcaddy at pro-set.com
Fri Jan 20 06:00:27 PST 2012


On 1/19/2012 11:04 AM, Kenneth Brody wrote:
> On 1/18/2012 4:41 PM, Rod Caddy wrote:
>> I have a customer running SCO Unix with Filepro 4.5.  They have a file
>> that they use as experimental documentation before they turn the product
>> into a real product number.  In the experimental file there is an
>> experimental number that was setup as (4, allup). They use the
>> processing below to increment the numbers.  The numbers are A000, A001,
>> etc.  The problem is that the Alpha does not increment correctly.  It
>> will work for a while and then will jump to Uxxx.(xxx being the numeric
>> portion of the number.  I am open to ideas here, I have tried modifying
>> the code several ways and have had very little success.
> [...]
>
> From your code, I assume what you want is a 4-digit code which 
> originally runs from 0000 to 9999.  After that, you want the thousands 
> place to wrap to letters, so that 9999->A000, A999->B000, and so on, 
> up to Z999.
>
> Is that correct?
>
> This assumes that "num" is the (4,allup) field you wish to "increment".
>
> ==========
> declare last3(4,0rj), first1(1,*)
> first1 = mid(num,"1","1") ; last3 = mid(num,"2","3") + "1"
> num = base(base(first1,"36")+int(last3/"1000"),"10","36") &
>       mid(last3,"2","3")
> ==========
>
Yes that is correct.

-- 

Pro-Set Systems Logo <www.pro-set.com>  Rod Caddy
   Pro-Set Systems
   rcaddy at pro-set.com
The information in this e-mail is confidential and may be privileged. If
   you are not the intended recipient, please destroy this e-mail and
   notify the sender immediately. You should not retain, copy, distribute
   or use this e-mail for any purpose, nor disclose any of its contents to
   any other person.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20120120/441043d3/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lglogo3.ico
Type: image/x-icon
Size: 6862 bytes
Desc: not available
Url : http://mailman.celestial.com/pipermail/filepro-list/attachments/20120120/441043d3/attachment.bin 


More information about the Filepro-list mailing list