IBM Support

Using RCVMSG and MONMSG to Retrieve QSHELL Messages

Troubleshooting


Problem

How to retrieve Qshell messages using the RCVMSG and MONMSG commands in a CL program?

Resolving The Problem

You can use the RCVMSG to retrieve the QSH0005,QSH0006, and QSH0007 messages as completion messages. If the QIBM_QSH_CMD_ESCAPE_MSG environment variable is set to Y, then you can use MONMSG to monitor for these messages as escape messages.

When the command ends, STRQSH sends one of the following messages:

oQSH0005 is sent when the process running the command ends normally. The message includes the exit status of the process.
oQSH0006 is sent when the process running the command ends by signal. The message includes the signal number.
oQSH0007 is sent when the process running the command ends by exception.

By default, the messages are sent as completion messages. You can have the messages sent as escape messages by setting the environment variable QIBM_QSH_CMD_ESCAPE_MSG. When the value of the environment variable is Y, the QSH0006 and QSH0007 messages are always sent as escape messages and the QSH0005 message is sent as an escape message if the exit status is greater than zero.

Note: After the environment variable is created and the value is set to Y, any active interactive sessions must be restarted to effect the change.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

24234933

Document Information

Modified date:
18 December 2019

UID

nas8N1010012