Is there an upper case function in RPGLE? I can't find one. We have a little routine that works but it is not clean. Anyone have a clean function they would like to share?
Announcement
Collapse
No announcement yet.
Upper case function
Collapse
X
-
Re: Upper case function
Hi rpgKnight:
Give this a shot:
Best of LuckCode:D A2ZU C CONST('ABCDEFGHIJKLMNOPQRST+ D UVWXYZ') D A2ZL C CONST('abcdefghijklmnopqrst+ D uvwxyz') /FREE MyString= %XLATE(a2zl:a2zu:MyString); /END-FREE
GLSThe problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln
-
Re: Upper case function
I believe the %upper bif is being implemented in RPGV.
Until then, you can wrap what GLS coded into a function / subprocedure. That way ,you dont need the arrays in each program. (Because you dont want some doofus changing a letter in the array, which would screw up the translation.)Michael Catalani
IS Director, eCommerce & Web Development
Acceptance Insurance Corporation
www.AcceptanceInsurance.com
www.ProvatoSys.com
Comment
-
Re: Upper case function
sql works
Code:update oezoord set ozcname = upper(substr(ozcname, 1, 1)) || lower(substr(ozcname, 2))
Code:d MyField s 30 inz('snfdAredff') /free exec sql select upper(:MyField) into :Myfield FROM SYSIBM/SYSDUMMY1; *inlr = *on; /end-free
This works -- I think
Code:* ------------------------------------------------------------- D ConvertCase PR ExtProc('QlgConvertCase') D 22 Request Control Blk D 92 options(*varsize) input data D 92 options(*varsize) returned data D 10i 0 const length of data Db like(vApiErrDS) error parm C callp ConvertCase(CaseCtlBlk:defkeyword: C defkeyword:%len(defkeyword):vApiErrDs)All my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
www.code400.com
Comment
-
Re: Upper case function
@Jamie:
When using SQL Scalar functions, you do not need to access any table, simply use the SQL SET statement:
... the SQL function UPPER works for single byte and double byte character sets and in any language environment you are working in (no need to care about any special characters such as the German ä,ü,ö)Code:/Free Exec SQL Set :UpperText = Upper(:MyText); /End-Free
BirgittaLast edited by B.Hauser; August 27, 2011, 03:28 AM.
Comment
-
Re: Upper case function
Thanks Birgitta
Have a great weekend.All my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
www.code400.com
Comment





Comment