Function
Description
BITXOR
Returns a string composed of the two input strings eXclusive ORed
together, bit by bit.
CONDITION
Returns the condition information, such as name and status, associated
with the current trapped condition.
DATE
Returns the date in the default format (
dd mon yyyy
) or in one of various
optional formats.
ERRORTEXT
Returns the error message associated with the specified error number.
EXTERNALS *
Returns the number of elements in the terminal input buffer. In TSO/E,
this function always returns a 0.
LINESIZE *
Returns the current terminal line width minus 1.
QUEUED
Returns the number of lines remaining in the external data queue at the
time when the function is invoked.
SOURCELINE
Returns either the line number of the last line in the source file or the
source line specified by a number.
TIME
Returns the local time in the default 24-hour clock format (
hh:mm:ss
) or
in one of various optional formats.
TRACE
Returns the trace actions currently in effect.
USERID *
Returns the TSO/E user ID, if the REXX exec is running in the TSO/E
address space.
VALUE
Returns the value of a specified symbol and optionally assigns it a new
value.
XRANGE
Returns a string of all 1-byte codes (in ascending order) between and
including specified starting and ending values.
* Indicates a non-SAA built-in function provided only by TSO/E.
Testing Input with Built-In Functions
Some of the built-in functions provide a convenient way to test input. When an
interactive exec requests input, the user might respond with input that is not valid.
For instance, in the example “Using Comparison Expressions” on page 31, the exec
requests a dollar amount with the following instructions.
SAY 'What did you spend for lunch yesterday?'
SAY 'Please do not include the dollar sign.'
PARSE PULL last
If the user responds with a number only, the exec will process that information
correctly. If the user responds with a number preceded by a dollar sign or with a
word, such as
nothing
, the exec will return an error. To avoid getting an error, you
can check the input with the DATATYPE function as follows:
DO WHILE DATATYPE(last) \= 'NUM'
SAY 'Please enter the lunch amount again.'
SAY 'The amount you entered was not a number without a dollar sign.'
PARSE PULL last
END
Other useful built-in functions to test input are WORDS, VERIFY, LENGTH, and
SIGN.
Exercise - Writing an Exec with Built-In Functions
Write an exec that checks a data set member name for a length of 8 characters. If
a member name is longer than 8 characters, the exec truncates it to 8 and sends
Built-In Functions
66
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: ......