Send Program Message (SNDPGMMSG)
The Send Program Message (SNDPGMMSG) command sends a message to a
named message queue or to a call message queue. A call message
queue can be the *EXT external message queue or a message queue
associated with a call stack entry. Each time a program or
procedure is called a new message queue is associated with its call
stack entry. The message queue is identified by the name of its
associated program or procedure.
A program can send a message to its own message queue or to a
message queue that is associated with a different call stack entry.
This command can send both exception and non-exception messages.
The SNDPGMMSG command allows a message of up to 512 characters
to be sent. However, if the message is sent to the *EXT
message queue of an interactive job, only 76 characters are
shown on the Display Program Messages display.
example
PGM
SNDPGMMSG MSG('simple message')
ENDPGM
OUTPUT
===> F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
simple message
------------------------------------------------
*************** Beginning of data *************************************
001.00 PGM
002.00 DCL VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +
003.00 name is RAMESH')
004.00 IF COND((%SST(&NAME 12 6)) *EQ 'RAMESH') THEN(DO)
005.00 SNDPGMMSG MSG(&NAME)
006.00 ENDDO
007.00 ENDPGM
****************** End of data ****************************************
output
in msgarea
my name is ramesh
__________________________________________
*************** Beginning of data ************************************
01.00 PGM
02.00 DCL VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +
03.00 name is RAMESH')
04.00 IF COND((%SST(&NAME 12 6)) *EQ 'RAMESH') THEN(DO)
05.00 SNDPGMMSG MSG(&NAME) TOPGMQ(*EXT)
06.00 ENDDO
07.00 ENDPGM
****************** End of data ***************************************
output
Job 421214/CHVRAMESH/QPADEV004S changed by JOBMANAGER.
Job 421214/CHVRAMESH/QPADEV004S changed by JOBMANAGER.
my name is RAMESH
The Send Program Message (SNDPGMMSG) command sends a message to a
named message queue or to a call message queue. A call message
queue can be the *EXT external message queue or a message queue
associated with a call stack entry. Each time a program or
procedure is called a new message queue is associated with its call
stack entry. The message queue is identified by the name of its
associated program or procedure.
A program can send a message to its own message queue or to a
message queue that is associated with a different call stack entry.
This command can send both exception and non-exception messages.
The SNDPGMMSG command allows a message of up to 512 characters
to be sent. However, if the message is sent to the *EXT
message queue of an interactive job, only 76 characters are
shown on the Display Program Messages display.
example
PGM
SNDPGMMSG MSG('simple message')
ENDPGM
OUTPUT
===> F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
simple message
------------------------------------------------
*************** Beginning of data *************************************
001.00 PGM
002.00 DCL VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +
003.00 name is RAMESH')
004.00 IF COND((%SST(&NAME 12 6)) *EQ 'RAMESH') THEN(DO)
005.00 SNDPGMMSG MSG(&NAME)
006.00 ENDDO
007.00 ENDPGM
****************** End of data ****************************************
output
in msgarea
my name is ramesh
__________________________________________
*************** Beginning of data ************************************
01.00 PGM
02.00 DCL VAR(&NAME) TYPE(*CHAR) LEN(20) VALUE('my +
03.00 name is RAMESH')
04.00 IF COND((%SST(&NAME 12 6)) *EQ 'RAMESH') THEN(DO)
05.00 SNDPGMMSG MSG(&NAME) TOPGMQ(*EXT)
06.00 ENDDO
07.00 ENDPGM
****************** End of data ***************************************
output
Job 421214/CHVRAMESH/QPADEV004S changed by JOBMANAGER.
Job 421214/CHVRAMESH/QPADEV004S changed by JOBMANAGER.
my name is RAMESH
No comments:
Post a Comment