TechTalk: Uncluttering the Program Messages Dsply

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: