IF((season = 'winter') | (snowing ='yes')) & (broken_leg ='no') THEN
\______________/
\____________/
\_____________/
false
true
true
\___________________/
/
true
/
\_____________________________/
true
As a result, when you run the exec, you see the message:
Go skiing.
Exercises - Using Logical Expressions
A student applying to colleges has decided to pick ones according to the following
specifications:
IF(inexpensive | scholarship) & (reputable | nearby) THEN
SAY "I'll consider it."
ELSE
SAY "Forget it!"
A college is inexpensive, did not offer a scholarship, is reputable, but is over 1000
miles away. Should the student apply?
ANSWER
Yes. The conditional instruction works out as follows:
IF(inexpensive | scholarship) & (reputable | nearby) THEN ...
\___________/ \___________/
\_________/ \______/
true
false
true
false
\___________/
\_________/
true
true
\_________________________/
true
Concatenation Operators
Concatenation operators combine two terms into one. The terms can be strings,
variables, expressions, or constants. Concatenation can be significant in formatting
output.
The operators that indicate how to join two terms are as follows:
Operator
Meaning
blank
Concatenate terms and place one blank in between. Terms that are
separated by more than one blank default to one blank when read.
For example:
SAY true
blue /* result is TRUE BLUE */
||
Concatenate terms and place no blanks in between. For example:
(8 / 2)||(3 * 3)
/* result is 49
*/
abuttal
Concatenate terms and place no blanks in between. For example:
per_cent'%'
/* if per_cent = 50, result is 50% */
Using Concatenation Operators
One way to format output is to use variables and concatenation operators as in the
following example. A more sophisticated way to format information is with parsing
and templates. Information about parsing appears in “Parsing Data” on page 87.
Using Expressions
34
z/OS V1R1.0 TSO/E REXX User’s Guide
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: ......