Previous Topic: ADDRESS InstructionNext Topic: INTERPRET Instruction


CALL Instruction

OPS/REXX supports an extension to the REXX CALL instruction.

CALL (name) [expression][,[expression]]...

The name is evaluated to determine the actual name of the called routine. The name cannot be an expression or a compound symbol itself. However, it can be a simple REXX symbol that contains the name of the routine to be called.

Because OPS/REXX resolves all external REXX subroutines at compile time, the name of any external subroutine must appear on a CALL instruction or a function call elsewhere in the program. If not, this message is issued during the compile phase:

REXX error 43: Routine not found

You may use this technique:

ExtRtn = 'EXTSUB3' /* For example */
CALL (ExtRtn)
/* Other REXX code */
exit
/* The following code will never be executed but is used
   to define the external subroutines used in the dynamic
   CALL above */
CALL EXTSUB1
CALL EXTSUB2
CALL EXTSUB3
CALL EXTSUB4