Convert CLVar Upper/Lower Case (CLCASE)

Where allowed to run:
  • Batch program (*BPGM)
  • Interactive program (*IPGM)
  • Batch ILE CL module (*BMOD)
  • Interactive ILE CL module (*IMOD)
Threadsafe: No
Parameters
Examples
Error messages

The Convert Letter Case (CLCASE) command converts the contents of a CL variable to all UPPER or all lower case letters. The original text (specifed on the VALUE parameter) is not modified. CLCASE has been deprecated in Cozzi appTools by the CLCONVERT command.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
VAR CL var for converted data Character value Required, Positional 1
VALUE Data to convert Character value Required, Positional 2
XLATE Translation target *TOUPPER, *TOLOWER, *UPPER, *LOWER Optional, Positional 3
Top

CL variable for converted text (VAR)

Specify a CL variable of TYPE(*CHAR) to receive the converted text. This can be the same variable as specified on the VALUE parameter or it may be another CL variable.

This is a required parameter.

Top

Text value to convert (VALUE)

Specify the original text to be converted.

This is a required parameter.

character-value
Specify a CL variable of TYPE(*CHAR) or a literal or expression value (an expression value must result in text).
Top
Top

Examples for CLCASE

Example 1: Convert to Upper Case

CLCASE  VAR(&NAME) VALUE(&USER)

By default the *TOUPPER option is selected, therefore this command will convert the contents of &USER to uppercase and store the results in the &NAME CL variable.

Example 2: Conver to Lower Case

DCL VAR(&NAME) TYPE(*CHAR) LEN(40)
CHGVAR VAR(&NAME) VALUE('COZZI APPTOOLS ARE COOL!')
CLCASE  VAR(&NAME) VALUE(&NAME) CASE(*TOLOWER)
  /* &NAME = 'cozzi apptools are cool!'   */

In this example, the text in &NAME is convert to lower case and is stored in &NAME.

Top

Error messages

Unknown
Top