If you consistently use the SNDUSRMSG command or the SNDPGMMSG command, you probably have noticed that the "Program Messages" display fills up pretty fast, showing a history of all the messages that have been sent up to the present.
There can be nothing more confusing to the user than having to read the entire screen just to find out that it is old history and can therefore be disregarded D the only message that really matters is the last one.
Fortunately, it is easy to remove the clutter. All you need to do is execute the following command before sending another message:
RMVMSG PGMQ(*EXT) + CLEAR(*ALL)
This clears all messages from the "external" program message queue. To see this technique at work, run the program listed in 5.
This clears all messages from the "external" program message queue. To see this technique at work, run the program listed in Figure 5.
As you will see, the first message is displayed and the system waits for a reply. Simply press Enter. Only the second message is shown after that.
But that's not all. You can create a command to perform this task whenever needed, since you are not allowed to run the RMVMSG command from the keyboard. The Clear External Program Queue (CLREXTPGMQ) command is listed in 6a; its processing program is listed in 6b. So, next time your "Program Messages" display begins to show too much clutter, simply type CLREXTPGMQ at the command line to zap all messages into oblivion.
But that's not all. You can create a command to perform this task whenever needed, since you are not allowed to run the RMVMSG command from the keyboard. The Clear External Program Queue (CLREXTPGMQ) command is listed in Figure 6a; its processing program is listed in Figure 6b. So, next time your "Program Messages" display begins to show too much clutter, simply type CLREXTPGMQ at the command line to zap all messages into oblivion.
Midrange Computing
TechTalk: Uncluttering the Program Messages Dsply
Figure 5 Sample CL program
Figure 5: Sample CL Program X: PGM DCL VAR(&REPLY) TYPE(*CHAR) LEN(1) SNDUSRMSG MSG('First message') MSGRPY(&REPLY) RMVMSG PGMQ(*EXT) CLEAR(*ALL) SNDUSRMSG MSG('Second message') MSGRPY(&REPLY) ENDPGM
TechTalk: Uncluttering the Program Messages Dsply
Figure 6A Command CLREXTPGMQ
CLREXTPGMQ: CMD PROMPT('Clear External Program Queue')
TechTalk: Uncluttering the Program Messages Dsply
Figure 6B CL program EXT001CL
EXT001CL: + PGM RMVMSG PGMQ(*EXT) CLEAR(*ALL) ENDPGM
LATEST COMMENTS
MC Press Online