EasyManuals Logo

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #31 background imageLoading...
Page #31 background image
EDIT ---- USERID.REXX.EXEC(TIMEGAME)------------------- COLUMNS 009 080
COMMAND ===> SCROLL ===> HALF
****** ************************ TOP OF DATA ************************************
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 IF usertime = '' 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 OF DATA **********************************
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 = number + 4
Syntax of REXX Instructions
Chapter 2. Writing and Running a REXX Exec 13

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals