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 #39 background imageLoading...
Page #39 background image
TYRANNOSAURUS
To cause the language processor to read input exactly as it is presented, use the
PARSE PULL instruction.
PARSE PULL animal
Then if you responded to the example with TyRannOsauRus, you would see on
the screen:
TyRannOsauRus
Exercises - Running and Modifying the Example Execs
Write and run the preceding Example of Reading and Re-displaying Input. Try
various input and observe the output. Now change the PULL instruction to a PARSE
PULL instruction and observe the difference.
Passing Information to an Exec
When an exec runs, you can pass information to it in several ways, two of which
are:
v Through terminal interaction
v By specifying input when invoking the exec.
Using Terminal Interaction
The PULL instruction is one way for an exec to receive input as shown by a
previous example repeated here.
Example of an Exec that Uses PULL
/**************************** REXX *********************************/
/* This exec adds two numbers and displays their sum. */
/*******************************************************************/
SAY 'Please enter a number.'
PULL number1
SAY 'Now enter a number to add to the first number.'
PULL number2
sum = number1 + number2
SAY 'The sum of the two numbers is' sum'.'
The PULL instruction can extract more than one value at a time from the terminal
by separating a line of input, as shown in the following variation of the previous
example.
Variation of an Example that Uses PULL
/**************************** REXX *********************************/
/* This exec adds two numbers and displays their sum. */
/*******************************************************************/
SAY 'Please enter two numbers.'
PULL number1 number2
sum = number1 + number2
SAY 'The sum of the two numbers is' sum'.'
Preventing Translation to Uppercase
Chapter 2. Writing and Running a REXX Exec 21

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