MSG
MSG returns the value ON or OFF, which indicates
the status of the displaying of TSO/E messages. That is, MSG indicates whether TSO/E messages are
being displayed while the exec is running.
- ON
- returns the previous status of message issuing (
ONorOFF) and allows TSO/E informational messages to be displayed while an exec is running. - OFF
- returns the previous status of message issuing (
ONorOFF) and inhibits the display of TSO/E informational messages while an exec is running.
msgstat = MSG() -> 'OFF' /* returns current setting (OFF) */
stat = MSG('off') -> 'ON' /* returns previous setting (ON) and
inhibits message display */You can use the MSG function only in REXX execs that run in the TSO/E address space.
Environment Customization Considerations: If you use IRXINIT to initialize language processor environments, note that you can use MSG only in environments that are integrated into TSO/E (see Types of environments - integrated and not integrated into TSO/E).
When an exec uses the MSG(OFF) function to inhibit the display of TSO/E messages, messages are not issued while the exec runs and while functions and subroutines called by that exec run. The displaying of TSO/E messages resumes if you use the MSG(ON) function or when the original exec ends. However, if an exec invokes another exec or CLIST using the EXEC command, message issuing status from the invoking exec is not carried over into the newly-invoked program. The newly-invoked program automatically displays TSO/E messages, which is the default.
The MSG function is functionally equivalent to the CONTROL MSG and CONTROL NOMSG statements for TSO/E CLISTs.
In non-TSO/E address spaces, you cannot control message output using the MSG function. However, if you use the TRACE OFF keyword instruction, messages do not go to the output file (SYSTSPRT, by default).
For more information about trapping or
suppressing output with the MSG function, see OUTTRAP versus MSG function when trapping or suppressing output.
Examples:
The following are some examples of using MSG.
- To inhibit the display of TSO/E informational messages while an exec is running, use MSG as
follows:
msg_status = MSG("OFF") - To ensure that messages associated with the TSO/E TRANSMIT command are not displayed before
including the TRANSMIT command in an exec, use the MSG function as follows:
IF MSG() = 'OFF' THEN, "TRANSMIT node.userid DA(myrexx.exec)" ELSE DO x = MSG("OFF") "TRANSMIT node.userid DA(myrexx.exec)" a = MSG(x) /* resets message value */ END
