Valid names of variables

You can define symbolic variables with meaningful names. Meaningful variable names, like PAY_RAISE, describe the contents of the variable and make CLISTs easy to read and maintain. Note that an ampersand (&) is not part of a variable name; it tells the CLIST to use the value of the variable. Follow these rules when naming a symbolic variable:

  1. The first character must be one of the following: A-Z, (a-z), _, #, $, @.
    Note: The system recognizes the following hexadecimal codes for these characters: _ (X'6D'), # (X'7B'), $ (X'5B'), @ (X'7C'). In countries other than the U.S., these characters on a keyboard might generate different hexadecimal codes and cause an error. For example, in some countries the $ character might generate a X'4A'.
  2. The remaining characters can be any of the above, and 0 through 9.
  3. The variable name can be up to 252 characters in length (not counting the ampersand).
  4. Variable names must not match the character equivalents of CLIST operators, such as EQ and NE (see Table 1 for a list).
  5. Special rules apply to the PROC statement. On PROC statements:
    • All variables must begin with A-Z, and be in uppercase only.
    • Names of keyword variables cannot contain the underscore (_), or be longer than 31 characters. For more information, see Using the PROC statement.
  6. If variables are used on ISPF panels, they cannot exceed eight characters in length.
  7. Do not use the names of statements or their keywords as variable names. This may cause unexpected results if used in a conditional statement, as in the following sequence:
    SET WHILE = &STR(ABC)
    DO UNTIL &WHILE = &STR(ABC) WHILE (&COUNT<5)
       SET &COUNT = &COUNT + 1
    END
    The results are also unpredictable if a keyword is used within a string, as in the following:
    SET COUNT = 0
    SET VAR = ABC
    DO UNTIL &VAR = &SUBSTR(3:3,WHILE) WHILE &COUNT < 5
     SET  COUNT =  &COUNT + 1
    END