Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

CL within RPG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CL within RPG

    The QCAPCMD API returns error information where QCMDEXC does not.

  • #2
    CL within RPG

    Just code an ERROR indicator on the CALL (or CALLP(e) in RPG IV). If the error indicator turns on, the command failed. Chris

    Comment


    • #3
      CL within RPG

      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) + ') '
      + 'OBJTYPE(*PGM)'
      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

      Comment


      • #4
        CL within RPG

        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

        Comment


        • #5
          CL within RPG

          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.

          Comment


          • #6
            CL within RPG

            Sure, here is an example. Mark
            Code

            Comment

            Working...
            X