Cases of characters in variables

There are restrictions on the cases 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 single quotation marks. 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 single quotation marks, it would have been correct, because without the single quotation marks 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 previous paragraph does not take into account the fact that conversion to uppercase is language dependent. Remember to rely on the system to convert values to uppercase can produce unexpected results.