Monitor for Specific Messages in RPG
May 2, 2007 Hey, Ted
I have a CL program that calls another CL program and monitors for specific escape messages. No big deal. I put multiple Monitor Message (MONMSG) commands after the CALL. Suppose I want to call the second CL program from an RPG program. How do I monitor for the different errors? –Ray OK, Ray, let’s set this up for the readers. Let’s suppose your program, which we’ll call SOMEPGM, can return escape messages MYM2101 and MYM2105. A CL caller monitors for those messages like this: CALL PGM(SOMEPGM) PARM(&whatever) MONMSG MSGID(MYM2101) EXEC(DO) /* do something */ ENDDO MONMSG MSGID(MYM2105) EXEC(DO) /* do |