z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


MSG

z/OS TSO/E REXX Reference
SA32-0972-00

Read syntax diagramSkip visual syntax diagram
>>-MSG(-+--------+-)-------------------------------------------><
        '-option-'     

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.

Using MSG, you can control the display of TSO/E messages from TSO/E commands and TSO/E external functions. Use the following options to control the display of TSO/E informational messages. Informational messages are automatically displayed unless an exec uses MSG(OFF) to inhibit their display.
ON
returns the previous status of message issuing (ON or OFF) and allows TSO/E informational messages to be displayed while an exec is running.
OFF
returns the previous status of message issuing (ON or OFF) and inhibits the display of TSO/E informational messages while an exec is running.
Here are some examples:
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).

Examples:

The following are some examples of using MSG.

  1. To inhibit the display of TSO/E informational messages while an exec is running, use MSG as follows:
    msg_status = MSG("OFF")
  2. 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

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014