× 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.



Rob, I tried your version and you are the closest to the solution I am
looking for.

Now, the catch here is that I need positions 3-4 to be only letter (alpha)
and 5-6 to be only numbers...


PETER VIDAL
MAPICS IT TECHNICAL SUPPORT TEAM / SR SYSTEM ANALYST
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
Tel:727-849-9999, x2414 Fax:727-815-3120
WWW.PALL.COM

"The beginning of anxiety is the end of faith; and the beginning of true
faith is the end of anxiety."
George Muller.




rob@xxxxxxxxx
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/22/2008 04:07 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: Increment an alpha field by "1"






call aa
DSPLY TAA02
DSPLY TAA10
DSPLY TB000

h dftactgrp(*no) actgrp(*caller)
d ds
d string 5a inz('TAA01')
d ds
d rplValues 36A
inz('0123456789ABCDEFGHIJKLMNOPQRSTU-
d VWXYZ')
d rplAry 1a dim(%len(rplValues))
d overlay(rplValues)
/free
*inlr=*on;
string='TAA01';
exsr bubble;
dsply string;
string='TAA0Z';
exsr bubble;
dsply string;
string='TAZZZ';
exsr bubble;
dsply string;
return;

begsr bubble;
if %subst(string:5:1)=rplAry(%elem(rplAry));
%subst(string:5:1)=rplAry(1);
if %subst(string:4:1)=rplAry(%elem(rplAry));
%subst(string:4:1)=rplAry(1);
if %subst(string:3:1)=rplAry(%elem(rplAry));
%subst(string:3:1)=rplAry(1);
if %subst(string:2:1)=rplAry(%elem(rplAry));
// oh shucks!
else;
%subst(string:2:1)=rplAry(%lookup(%subst(string:2:1):rplAry)+1);
ENDIF;
Else;
%subst(string:3:1)=rplAry(%lookup(%subst(string:3:1):rplAry)+1);
ENDIF;
Else;
%subst(string:4:1)=rplAry(%lookup(%subst(string:4:1):rplAry)+1);
ENDIF;
else;
%subst(string:5:1)=rplAry(%lookup(%subst(string:5:1):rplAry)+1);
ENDIF;
endsr;


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.