Using the built in function %UPPER in a CL

Frosty the Coder

Legendary Poster
I'm coding a CLP where a value comes to me in mixed upper/lower case.
I'm trying to use the %UPPER built in function to get unmixed upper case.

Per the IBM documentation:
"The %UPPER built-in function returns a character string that is the same length as the argument specified with each lowercase letter replaced by the corresponding uppercase letter.

The %UPPER built-in function can be used anywhere that CL supports a character expression.
%UPPER can be used alone or as part of a more complex character expression.

For example, %UPPER can be used to convert character CL variables to have only upper case characters
before comparing them in the COND parameter of an IF or WHEN command.

%UPPER can also be used to set the value of a CL command parameter,
if the associated command object defines the parameter with EXPR(*YES) and TYPE of *CHAR, *NAME, *SNAME, *CNAME, *PNAME, *GENERIC, *DATE, *TIME, or *X."


They cite an example of:
SNDPGMMSG (%UPPER(&STR))

When I try to use %UPPER, even the IBM example, I get error CPD0056
"Message . . . . : Built-in function %UPPPER not valid.
Cause . . . . . : Built-in function name not found or built-in function name is not valid for the type of program in which it is specified.
Recovery . . . : Change the name specified for the built-in function or omit the percent sign in front of the name."


Does %UPPER work in CLP?
Would someone please post an example of %UPPER in a CLP?

Thanks
Frosty
 
Thanks for the reply.
I checked, and we are on V7R1, and %UPPER isn't available.
RATS!

Thanks,
Frosty
 
Back
Top