Rules for a command response WTO
- Specify descriptor code 5 (DESC=5)
- Identifies message as a command response
- Can have additional descriptor codes, if wanted
"Extended" (program) consoles have an option to receive only command responses, and ignore "unsolicited" messages. These programs depend on a command response message being marked as such.
"Unsolicited" messages are those which are directed to a console because of routing codes, or some other routing attribute. They have not been directly "solicited" by the operator. Command responses are considered "solicited" messages.
- Direct the message to the console which issued the command (CONSID=cccc), using the 4-byte console ID of the console which issued the command. All consoles have a 4-byte console ID, which can be used to direct the message to the issuing console.
- Return the CART value specified on the command (CART=vvvvvvvv)
CART data is an 8-byte field passed to you from the input command.
All programs which use the MGCRE macro to issue commands can specify a Command And Response Token (CART) to identify "which command" this is a response to.
If the command issuer did not use a CART, it is still safe to say "CART=" on the WTO, and point to the CART field in your control block. In this case, the CART is propagated as a field of zeroes.
- Issue one and only one message in response to the command.
It is preferable to respond with one message, which may be many lines of text. You can issue a multiple line message "all at once", or use the CONNECT parameter. Don't forget to "end" the message (issue an end line or data-end line).
Be sure to clear register zero before issuing a WTO for a line (or block of lines) of a multiple-line message. If MVS™ finds a non-zero value in register zero, it will assume you are trying to CONNECT to a message with that message ID.