PDA

View Full Version : CL within RPG



Guest.Visitor
06-04-2002, 12:08 PM
The QCAPCMD API returns error information where QCMDEXC does not.

Guest.Visitor
06-04-2002, 12:39 PM
Just code an ERROR indicator on the CALL (or CALLP(e) in RPG IV). If the error indicator turns on, the command failed. Chris

Guest.Visitor
06-04-2002, 10:57 PM
Hi, use the (E)-Extender on the call statement and define the Program Status Datastructure in your RPG Program: D PGMSTA SDS D MsgText 91 170 Message-Text If you get an Error in your CL command you get the Message-Text in MsgText For example to check object existence: C eval P$cmd = 'CHKOBJ OBJ(' + %Trim(P$PGM) + ') ' <center> + 'OBJTYPE(*PGM)' </center>C callp (E) Qcmdexc(P$Cmd: %Len(P$Cmd)) C if %Error C eval MsgId = 'CPF9898' C eval MsgData= MsgText C eval MsgFile= 'QCPFMSG *LIBL' C exsr SndPgmMsg C endif Birgitta

Guest.Visitor
10-14-2002, 10:49 PM
Dear Mark, Do you know where I can find which parameters QCAPCMD take? I would really like to try it out. I know it takes 9 parameters but I don't know the format of them. Thanks a lot. BR Jörgen

Guest.Visitor
10-15-2002, 08:10 AM
I'm using the API QcmdExc to run CL commands from an RPGIV program. This works great until there is a CL error. Is there a way to "Monitor Msg" from my RPG as well? Thanks for any ideas.

Guest.Visitor
10-15-2002, 08:10 AM
Sure, here is an example. Mark <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.5bfa8799/4')