Using the INTERPRET Instruction
The INTERPRET instruction not only evaluates an expression, but
also treats it as an instruction after it is evaluated. Thus if a
combination of the previous examples were used with the INTERPRET
instruction, answer becomes "10".
answer = 5 + 5
INTERPRET 'say' answer '"= 5 + 5"' /* displays 10 = 5 + 5 */You can also group a number of instructions within a string, assign
the string to a variable, and use the INTERPRET instruction to execute
the instructions assigned to the variable.
action = 'DO 3; SAY "Hello!"; END'
INTERPRET action /* results in:
Hello!
Hello!
Hello! */Because the INTERPRET instruction causes dynamic modification, use it very carefully. For more information about the INTERPRET instruction, see z/OS TSO/E REXX Reference.