TechTalk: Keeping Your Message Files Under Contro

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

The AS/400 creates a message queue for each display device and user on the system. These message queues can grow in size if the user does not clear received messages. The program, MSG00CL, and two other associated programs, MSG01CL and MSG01, will save the messages of each message queue to a file and then will clear the queue.

The CL program MSG00CL uses the DSPOBJD command to create a file of all type of *MSGQ objects within the library list. The program reads the created file and will call MSG01CL to process each message queue. Program MSG01CL is called using the message queue and message queue library as parameters. MSG01CL will create a file (WRKF) in the current library (if the file does not exist), and will receive the messages from the top of the message queue, removing each message so the next message becomes the top message. For each message, a call is made to an RPG program (MSG01) with the message text, message queue library, and message queue as parameters. The RPG program writes each message to file WRKF. MSG01CL will not process the QHST message queue or message queues that are allocated to other users. Running the CLRMSGQ command after all messages have been removed reduces the size of the queue.

The program MSG01CL can be called from the command line or from any other program using the message queue and library as parameters.

Alon Fluxman Highlands Ranch, Colorado


TechTalk: Keeping Your Message Files Under Contro

Figure 1 RPG program MSG01

 FWRKF O F 152 DISK C *ENTRY PLIST C PARM MSG 132 C PARM MSGQ 10 C PARM MSGQL 10 C EXCPT#OUT C SETON LR OWRKF E #OUT O MSGQ 10 O MSGQL 20 O MSG 152 
TechTalk: Keeping Your Message Files Under Contro

Figure 2 CL program MSG00CL

 MSG00CL: + PGM DCLF FILE(QSYS/QADSPOBJ) DLTF FILE(QTEMP/WRKF1) MONMSG MSGID(CPF2105) DSPOBJD OBJ(*ALL) OBJTYPE(*MSGQ) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/WRKF1) OUTMBR(*FIRST *ADD) OVRDBF FILE(QADSPOBJ) TOFILE(QTEMP/WRKF1) MBR(*ALL) LOOP: + RCVF MONMSG MSGID(CPF0864) EXEC(RETURN) CALL PGM(MSG01CL) PARM(&ODOBNM &ODLBNM) GOTO CMDLBL(LOOP) ENDPGM 
TechTalk: Keeping Your Message Files Under Contro

Figure 3 CL program MSG01CL

 MSG01CL: + PGM PARM(&MSGQ &MSGQLIB) DCL VAR(&MSGQ) TYPE(*CHAR) LEN(10) DCL VAR(&MSGQLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSG) TYPE(*CHAR) LEN(10) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(10) MONMSG MSGID(CPF2451 CPF2433) EXEC(GOTO CMDLBL(END)) CRTPF FILE(*CURLIB/WRKF) RCDLEN(152) MONMSG MSGID(CPF5813 CPF7302) EXEC(GOTO CMDLBL(OVR)) OVR: + OVRDBF FILE(WRKF) TOFILE(*CURLIB/WRKF) LOOP: + RCVMSG MSGQ(&MSGQLIB/&MSGQ) MSGTYPE(*NEXT) MSGKEY(*TOP) + RMV(*YES) MSG(&MSG) IF COND(&MSG *EQ ' ') THEN(DO) CLRMSGQ MSGQ(&MSGQLIB/&MSGQ) RETURN ENDDO CALL PGM(MSG01) PARM(&MSG &MSGQ &MSGQLIB) GOTO CMDLBL(LOOP) END: + RETURN 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: