EDIT ---- USERID.REXX.EXEC(TIMEGAME)------------------- COLUMNS 009 080
COMMAND ===>
SCROLL ===> HALF
****** ************************ TOP OFDATA ************************************
000001 /************************** REXX ****************************/
000002 /* This is an interactive REXX exec that asks a user for the*/
000003 /* time and then displays the time from the TIME command.
*/
000004 /************************************************************/
000005 Game1:
000006
000007 SAY 'What time is it?'
000008 PULL usertime
/* Put the user's response
000009
into a variable called
000010
"usertime" */
000011 IFusertime = '' THEN
/* User didn't enter a time */
000012
SAY "O.K. Game's over."
000013 ELSE
000014
DO
000015
SAY "The computer says:"
000016
/* TSO system */ TIME
/* command */
000017
END
000018
000019 EXIT
****** *********************** BOTTOM OFDATA **********************************
Keyword
A keyword instruction tells the language processor to do something. It begins with a
REXX keyword that identifies what the language processor is to do. For example,
SAY (line 7) displays a string on the screen and PULL (line 8) takes one or more
words of input and puts them into the variable
usertime
.
IF, THEN (line 11) and ELSE (line 13) are three keywords that work together in one
instruction. Each keyword forms a clause, which is a subset of an instruction. If the
expression that follows the IF keyword is true, the instruction that follows the THEN
keyword is processed. Otherwise, the instruction that follows the ELSE keyword is
processed. If more than one instruction follows a THEN or an ELSE, the
instructions are preceded by a DO (line 14) and followed by an END (line 17). More
information about the IF/THEN/ELSE instruction appears in “Using Conditional
Instructions” on page 42.
The EXIT keyword (line 19) tells the language processor to end the exec. Using
EXIT in the preceding example is a convention, not a necessity, because
processing ends automatically when there are no more instructions in the exec.
More about EXIT appears in “EXIT Instruction” on page 57.
Assignment
An assignment gives a value to a variable or changes the current value of a
variable. A simple assignment instruction is:
number = 4
In addition to giving a variable a straightforward value, an assignment instruction
can also give a variable the result of an expression. An expression is something
that needs to be calculated, such as an arithmetic expression. The expression can
contain numbers, variables, or both.
number = 4 + 4
number = 4
Syntax of REXX Instructions
Chapter 2. Writing and Running a REXX Exec
13
Summary of Contents for TSO/E REXX
Page 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 2: ......
Page 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Page 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Page 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Page 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Page 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Page 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Page 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Page 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Page 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Page 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Page 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Page 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Page 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Page 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Page 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Page 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Page 241: ......