TechTalk: How to Display Info Messages on Line 24

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

How to Display Info Messages on Line 24

Q: I'm trying to duplicate IBM's method of displaying informational messages on line 24 of our AS/400 displays while processing an AS/400 command/program. I don't want to clear the display first-just display a short informational message on line 24 every few seconds as a CL program is running. How do I do this?

- Chris Kurtz

A: You need to use the Send Program Message (SNDPGMMSG) command, specifying MSGTYPE(*STATUS) TOPGMQ(*EXT). *STATUS messages require you to use the MSGID/MSGF/MSGDTA parameter trio instead of the MSG parameter; but you can use MSGID(CPF9898) or MSGID(CPF9897) in QCPFMSG, specifying the text of your message in the MSGDTA parameter. The only difference between CPF9898 and CPF9897 is that CPF9898 adds a period after whatever you type in MSGDTA.

For example, suppose you want to send the following message while the CL program is running: "Now reorganizing Customer Master file. Please wait."

You'd code the CL program as follows:

 SNDPGMMSG MSGID(CPF9898) + MSGF(QCPFMSG) MSGDTA('Now + reorganizing the Customer + Master file. Please wait') + TOPGMQ(*EXT) MSGTYPE(*STATUS) RGZPFM FILE(CUSTMAST) 

Notice that the message text is in the MSGDTA parameter, minus the ending period; that's because CPF9898 automatically adds a final period.

The message will stay in line 24 until another status message is issued either by you or by IBM-supplied commands. (OPNQRYF, for example, sends status messages of its own.)

If you want to remove a message without sending another, send a blank status message using CPF9897:

 SNDPGMMSG MSGID(CPF9897) + MSGF(QCPFMSG) MSGDTA(' ') + TOPGMQ(*EXT) MSGTYPE(*STATUS) 

This allows you to remove a message some time after sending it, when it is no longer relevant.

One final note. Both the user profile and the job have attributes to display or omit status messages. For example, you can use CHGJOB STSMSG(*NONE) to change your job so that no *STATUS messages are ever displayed.

- Ernie Malaga

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: