Variable Names

A variable name, the part that represents the value, is always on the left of the assignment statement and the value itself is on the right. In the following example, the variable name is variable1.
variable1 = 5
SAY variable1
As a result of the preceding assignment statement, the language processor assigns variable1 the value 5, and the SAY produces:
5
Variable names can consist of:
A–Z
uppercase alphabetic
a–z
lowercase alphabetic
0–9
numbers
? ! . _
special characters
X'41'–X'FE'
double-byte character set (DBCS) characters. (OPTIONS ETMODE must be the first instruction in your program for these characters to be valid in a variable name.)
Restrictions on the variable name are:
  • The first character cannot be 0 through 9 or a period (.)
  • The variable name cannot exceed 250 bytes. For names containing DBCS characters, count each DBCS character as 2 bytes, and count the shift-out (SO) and shift-in (SI) as 1 byte each.
  • SO (X'0E') and SI (X'0F') must delimit DBCS characters within a DBCS name. Also note that:
    • SO and SI cannot be contiguous.
    • Nesting of SO / SI is not permitted.
    • A DBCS name cannot contain a DBCS blank (X'4040').
  • The variable name should not be RC, SIGL, or RESULT, which are REXX special variables. More about special variables appears later in this book.
Examples of acceptable variable names are:
ANSWER    ?98B    A   Word3   number  the_ultimate_value

Also, if OPTIONS ETMODE is the first instruction in your program, the following are valid DBCS variable names, where < represents shift-out, > represents shift-in, X, Y, and Z represent DBCS characters, and lowercase letters and numbers represent themselves.

<.X.Y.Z>   number_<.X.Y.Z>   <.X.Y>1234<.Z>

Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/varn.html