Previous Topic: How OPS/REXX Programs in the AOF WorkNext Topic: Execute OPS/REXX Programs from Batch


Call the Interpreter from an OPS/REXX Program

An OPS/REXX program can call the OPS/REXX interpreter as an OPS/REXX function or subroutine. This calling method is not efficient, but it can be useful in special situations.

Use either of the following statements to call the interpreter from another OPS/REXX program:

variable = OI("member argument")
CALL OI "member argument"
ADDRESS TSO
  "OI member argument"
  "OX dsname argument"

The value returned by the function calls (or into variable RESULT by the CALL instructions) is the error code of the interpreter. Usually, this value is the same as any standard REXX error code (or zero if the program was interpreted without errors).

When you use the ADDRESS TSO form, any messages and output produced by the program (including TRACE output) are returned in the external data queue just like other TSO commands (unless the calling program is executing under an AOF rule).