Variable Names - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Using Variables
big = 1000000
Variables can refer to different values at different times. If you assign a different
value to big, it gets the value of the new assignment, until it is changed again.
big = 999999999
Variables can also represent a value that is unknown when the exec is written. In
the following example, the user's name is unknown, so it is represented by the
variable who.
SAY "Hello! What's your name?"
PARSE PULL who

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 word "variable1" is the variable name:
variable1 = 5
SAY variable1
As a result of the above assignment statement, variable1 is assigned the value "5",
and you see on the terminal screen:
Variable names can consist of:
A...Z
a...z
0...9
@ # $ ¢ ? ! . _
X'41' ... X'FE'
Restrictions on the variable name are:
v The first character cannot be 0 through 9 or a period (.)
v The variable name cannot exceed 250 bytes. For names containing DBCS
v DBCS characters within a DBCS name must be delimited by SO (X'0E') and SI
v The variable name should not be RC, SIGL, or RESULT, which are REXX special
Examples of acceptable variable names are:
ANSWER
26
z/OS V1R1.0 TSO/E REXX User's Guide
/* Put the person's name in the variable "who" */
5
characters, count each DBCS character as two bytes, and count the shift-out
(SO) and shift-in (SI) as one byte each.
(X'0F'). 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').
variables. More about special variables appears later in this book.
?98B
X
Word3
uppercase alphabetic
lowercase alphabetic
numbers
special characters
double-byte character set (DBCS) characters.
(ETMODE must be on for these characters to be
valid in a variable name.)
number the_ultimate_value

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents