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 = n 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 = n number2
SAY 'The sum of the two numbers is' sum'.'
Preventing Translation to Uppercase
Chapter 2. Writing and Running a REXX Exec
21
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......