THE RPGIV LIBRARY

Home
Contributions
qrpglesrc
qcpysrc

      *****************************************************************
     D Example2        pr

      *---------------------------------------------------------------*
      *    This program executes the OS/400 command CHKOBJ.
      *    MsgID 'CPF9801' is returned if object not found.
      *---------------------------------------------------------------*

      /COPY QCPYSRC,ExecCmd

     D Example2        pi

     D MsgID           s              7a
     D Parms           s            128a

      * Check existence of library QSYS:
      * (Something very wrong if this returns a msg)
     C                   eval      MsgID=ExecCmd('CHKOBJ OBJ(QSYS)'
     C                                          +' OBJTYPE(*LIB)'
     C                                          :Parms)

      * Check existence of user space 'MICKEYRAT':
      * (I'd be surprised if this didn't return a message)
     C                   eval      MsgID=ExecCmd('CHKOBJ OBJ(MICKEYRAT)'
     C                                          +' OBJTYPE(*USRSPC)'
     C                                          :Parms)



     C                   eval      *INLR=*ON
     C                   return
      *****************************************************************