PDA

View Full Version : TOUPPER--Convert Lowercase Letters to Uppercase



jcobrienx2@aol.com
12-31-1969, 06:33 PM
** This thread discusses the article: TOUPPER--Convert Lowercase Letters to Uppercase (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3904) **
Bob, another way (always at least twenty) for easy Upper and Lower case conversion is by prototyping a much less complicated call to QLGCNVCS API. These prototypes eliminate dealing with the complicated parameter structures required by the API calls. This sample would be usable in an RPGLE module simply as the result of an EVAL. Source for RPGLE module and /COPY book of prototyped procedure definitions attached as one document. The module would be in a *BNDDIR that a *SRVPGM would have included on program creation or update. Thanks from Joe O'Brien. ex. C EVAL UpperFld = UpperCase(LowerFld) ex. C EVAL LowerFld = LowerCase(Anyfield)

R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: TOUPPER--Convert Lowercase Letters to Uppercase (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3904) **
Here's the original version of TOUPPER using both VARYING and OPTIONS(*VARSIZE) <PRE> P ToUpper B D*ame+++++++++++EUDS.......Length+TDc.Functions+++ ++++++++++++++ D ToUpper PI 2048A VARYING OPDESC D InputStg 2048A VARYING CONST OPTIONS(*varsize) D RtnValue S 2048A VARYING D lower C Const('abcdefghijklmnopqrstuvwxyz') D upper C Const('ABCDEFGHIJKLMNOPQRSTUVWXYZ') D nLen S 10I 0 .....C*Rn01..............OpCode(ex)Extended-factor2+++++++++++++++++++++++++++ C Eval RtnValue = '' C If %Parms=0 C return RtnValue C endif C callP GetOpDesc(1 : nDescType : nDataType : C nDescInf1 : nDescInf2 : nLen : C *OMIT ) C If nLen > 0 and %Len(InputStg) > 0 C if %Len(InputStg) < nLen C eval nLen = %len(InputStg) C endif C eval RtnValue = %subst(InputStg : 1 : nLen) C Eval %Len(RtnValue) = nLen C lower:UPPER xLate RtnValue RtnValue C endIf C Return %subst(RtnValue:1:nLen) P ToUpper E </PRE>

R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: TOUPPER--Convert Lowercase Letters to Uppercase (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3904) **
This API is the basis for RPG xTools CvtCase() subprocedure. I am featuring it in the July 5th 2005 issue of the newsletter.

V.Mack
12-31-1969, 06:33 PM
** This thread discusses the article: TOUPPER--Convert Lowercase Letters to Uppercase (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3904) **
** This thread discusses the Content article: TOUPPER--Convert Lowercase Letters to Uppercase (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3904)0