COZZI - Send CMD Message (SNDCMDMSG)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The COZZI - Send CMD Message (SNDCMDMSG) command Sends a CL command to the Joblog as a Request MSGTYPE(*RQS) message. This allows the command to be retrieve using the F9 function key. The command may be logged and run or simply logged.

Then the TOPGMQ parameter is *PRV or *SAME, the command is simply logged to the joblog for the job. But the end-user may use the Retrieve Command function key (F9) to retreive the command as if it were previously entered. Sending to *PRV or *SAME logs the CL command to the joblog. If TOPGMQ(*EXT) is specified, the command may be left active (not received) in which case upon returning to Command Entry from the CL program that issued the SNDCMDMSG command, the CL command specified on the CMD parameter WILL BE RUN. If several SNDCMDMSG commands are issued in the CL program, they will be run, agin upon returning to the callers Command Entry, as if entered on Command Entry, one after the other.

Top

Parameters

Keyword Description Choices Notes
CMD CL Command Command string Optional, Positional 1
TOPGMQ To program queue (TOPGMQ) *SAME, *PRV Optional, Positional 2
OPTION Run and Log or Log only *RUN, *LOG Optional, Positional 3
Top

CL Command (CMD)

Specifies a CL command to write to the joblog as a Request message. The command is always written to the joblog regardless of the ACTION parameter setting. If TOPGMQ(*EXT) and ACTION(*RUN) are specified, the command may be run when returning to the Command Entry screen (depending on environment settings). Once the command is logged, it may be retrieved using the Retrieve Previous Command function key, F9 or the QMHRTVRQ API.

command-string
Specify any valid CL command string to be written to the joblog.
Top

To program queue (TOPGMQ) (TOPGMQ)

Specifies the program queue to which the CL command is written.

*EXT
The CL Command specified on the CMD parameter is written to the *EXT job message queue.
*PRV
The CL Command is written to the previous invocation program message queue.
*SAME
The CL Command is written to the same program invocation as that of the program issuing the the SNDCMDMSG command.
Top
Top

Examples for SNDCMDMSG

Example 1: Simple Command Example

SNDCMDMSG  KWD1(PARMVAL1)

This command <...>

Example 2: More Complex Command Example

SNDCMDMSG   KWD1(PARMVAL1)  KWD2(PARMVAL2)
            KWD3(PARMVAL3)

This command <...>

Top

Error messages for SNDCMDMSG

*ESCAPE Messages

CPF9801
Object &2 in library &3 not found.
CPF9802
Not authorized to object &2 in &3.
CPF9803
Cannot allocate object &2 in library &3.
CPF9807
One or more libraries in library list deleted.
CPF9808
Cannot allocate one or more libraries on library list.
CPF9810
Library &1 not found.
CPF9811
Program &1 in library &2 not found.
CPF9812
File &1 in library &2 not found.
CPF9820
Not authorized to use library &1.
CPF9830
Cannot assign library &1.
CPF9899
Error occurred during processing of command.
Top