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.