+ Reply to Thread
Results 1 to 6 of 6

Thread: CL within RPG

  1. #1
    Guest.Visitor Guest

    Default CL within RPG

    The QCAPCMD API returns error information where QCMDEXC does not.

  2. #2
    Guest.Visitor Guest

    Default 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

  3. #3
    Guest.Visitor Guest

    Default 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

  4. #4
    Guest.Visitor Guest

    Default 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

  5. #5
    Guest.Visitor Guest

    Default 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.

  6. #6
    Guest.Visitor Guest

    Default CL within RPG

    Sure, here is an example. Mark
    Code

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts