Where allowed to run:
|
Parameters Examples Error messages |
The Change System/36 Message List (CHGS36MSGL) command determines the action taken for specific escape messages issued by Control Language (CL) commands in a procedure running in the System/36 environment. It is also used to set the default action for escape messages that are not specified.
This command is allowed to be external to a procedure only when SCOPE(*JOB) or SCOPE(*SESSION) is specified. It is not allowed in CL programs. It is valid only when the System/36 Environment is active.
For System/36 environment jobs that are started by the JOBQ command, the // JOBQ OCL statement, or the // EVOKE OCL statement, the initial message default action is taken from the job level of the submitting job. For other jobs, it is taken from the System/36 environment configuration. The Change System/36 Configuration (CHGS36) command can be used to set the initial message default action in the configuration.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
MSGL | Message list | Single values: *SAME, *NONE Other values (up to 100 repetitions): Element list |
Optional, Positional 1 |
Element 1: Message list | Values (up to 100 repetitions): Name, *ANY | ||
Element 2: Action | *CONTINUE, *IGNORE, *HALT, *CANCEL, *GOTO | ||
Element 3: Label or halt option | Character value | ||
DFTACN | Default action | Single values: *SAME Other values: Element list |
Optional |
Element 1: Action | *CONTINUE, *IGNORE, *HALT, *CANCEL, *GOTO | ||
Element 2: Label or halt option | Character value | ||
SCOPE | Scope | *CURPRC, *PRVPRC, *JOB, *SESSION | Optional |
Top |
Specifies a list of message IDs and the action that is taken for each message. One or more message IDs can be specified along with the action that is taken for each message ID. When a CL command issues an escape message, the message list is searched for the message ID and the specified action is taken. If the message ID is not found in the message list, the default action is taken.
Note: The MSGL parameter can be specified only if SCOPE(*CURPRC) or SCOPE(*PRVPRC) is specified.
The possible Message ID Added to List values are:
The message list is searched in the order that it is specified on the command. Therefore, if the message list contains more than one message ID that matches the message ID being searched for, the first one is used. For example, if the message list contains CPF1200 followed by CPF1234, and the message CPF1234 is being searched for, the generic message ID is found first, and the action specified for that message ID is taken.
The possible Action Taken for Message ID values are:
Top |
Specifies the default action taken for escape messages issued by CL commands in procedures that run in the System/36 environment. The default action is taken for any message that is not in the message list, or for any message if there is no message list. The default action is not used if the message list contains a message ID of *ANY.
Top |
Specifies the scope of the message list and default action entered on the command.
Top |
Example 1: Setting Up a Message List
CHGS36MSGL MSGL(((CPF9801) *GOTO NOTEXIST) ((CPF9802 CPF9820) *GOTO NOTAUT) ((*ANY) *HALT 3)) CHKOBJ ?2?/?1? *PGM // GOTO OK // TAG NOTEXIST (code to handle object does not exist messages) // GOTO OK // TAG NOTAUT (code to handle not authorized to object messages) // TAG OK CHGS36MSGL MSGL(*NONE)
This command sets up a message list to go to label NOTEXIST if message CPF9801 is issued, and to label NOTAUT if either message CPF9802 or CPF9820 is issued. If any other message is entered, a halt with only option 3 (cancel) is issued. The second CHGS36MSGL command removes the message list.
Example 2: Setting the ?MSGID? Substitution Expression
CHGS36MSGL MSGL(((CPF2105) *IGNORE) ((*ANY) *CONTINUE)) DLTF ?FLIB?/?1? // IFF ?MSGID?/ ... (handle error)
In this example, message CPF2105 (object not found) is ignored; that is, the ?MSGID? substitution expression is not set. For any other messages, the ?MSGID? substitution expression is set to the message ID. The procedure is attempting to delete a file that may or may not exist. Because the object not found exception is not considered an error in this case, it is ignored. Any other message is handled as an error.
Top |
*ESCAPE Messages
Top |