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
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.
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:
LATEST COMMENTS
MC Press Online