Special Variables-IBM REXX - IBM-REXX

There are three special variables that the language processor can set automatically:

RC
is set to the return code from any executed host command (or subcommand).Following the SIGNAL events SYNTAX, ERROR, and FAILURE, RC is set to the code appropriate to the event: the syntax error number or the command return code. RC is unchanged following a NOVALUE or HALT event.

Note:Host commands issued manually from debug mode do not cause the value of RC to change. The special variable RC can also be set to a -3 if the host command could not be found.

The TSO/E REXX commands also return a value in the special variable RC. Some of the commands return the result from the command.For example, the QBUF command returns the number of buffers currently on the data stack in the special variable RC.

RESULT
is set by a RETURN instruction in a subroutine that has been called, if the RETURN instruction specifies an expression. If the RETURN instruction has no expression, RESULT is dropped (becomes uninitialized.)

SIGL
contains the line number of the clause currently executing when the last transfer of control to a label took place. (A SIGNAL, a CALL, an internal function invocation, or a trapped error condition could cause this.)

None of these variables has an initial value.You can alter them, just as with any other variable,and they can be accessed using the variable access routine IRXEXCOM.The PROCEDURE and DROP instructions also affect these variables in the usual way.

Certain other information is always available to a REXX program. This includes the name by which the program was invoked and the source of the program. The data that PARSE SOURCE returns is:

  1. The character string TSO
  2. The call type (command, function, or subroutine)
  3. Name of the exec in uppercase
  4. Name of the DD from which the exec was loaded, if known
  5. Name of the data set from which the exec was loaded, if known
  6. Name of the exec as invoked (that is, not folded to uppercase)
  7. Initial (default) host command environment
  8. Name of the address space in uppercase
  9. Eight character user token

In addition,PARSE VERSION makes available the version and date of the language processor code that is running.The built-in functions TRACE and ADDRESS return the current trace setting and host command environment name,respectively.Finally, you can obtain the current settings of the NUMERIC function using the DIGITS, FORM, and FUZZ built-in functions.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-REXX Topics