CL Command Reference - CHGS36MSGL
CL Command List > CHGS36MSGL Reference
Description:
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.
Examples:
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.