Case of characters in variables

There are restrictions on the case used for characters in variables.

Reserved values, such as *LIBL, that can be used as variables must always be expressed in uppercase letters, especially if they are presented as character strings enclosed in apostrophes. For instance, if you wanted to substitute a variable for a library name on a command, the correct code is as follows:

DCL VAR(&LIB) TYPE(*CHAR) LEN(10) VALUE('*LIBL')
DLTPGM &LIB/MYPROG;

However, it would be incorrect to specify the VALUE parameter this way:

DCL VAR(&LIB) TYPE(*CHAR) LEN(10) VALUE('*libl')

Note that if this VALUE parameter had not been enclosed in apostrophes, it would have been correct, because without the apostrophes it would be translated to uppercase automatically. This error frequently occurs when the parameter is passed as input to a procedure or program from a display as a character string, and the display entry is made in lowercase.

Note: The above paragraph does not take into account the fact that conversion to uppercase is language dependent. REMEMBER: Relying on the system to convert values to uppercase may produce unexpected results.