Giovanni's logo
Execute a command
using DoCmd subprocedure
this means Version 2
power search
blue line
This subprocedure allows an RPG-ILE program to run a CL command.

 * Variables common to all CGIs
 /copy mysrclib/qrpglesrc,prototypeb
 /copy mysrclib/qrpglesrc,usec
 /copy mysrclib/qrpglesrc,variables3
 *          ... etc. ...
 * Override database file CTRDVY
C                   eval      rc = docmd('OVRDBF FILE(CTRDVY) +
C                             TOFILE(CGIDEV2/CTRDVY) +
C                             SECURE(*YES) OVRSCOPE(*JOB)')
 *          ... etc. ...
C                   eval      rc = docmd('DLTOVR CTRDVY LVL(*JOB)')
On return from docmd, variable rc (return code) contains
  • 0, if the command was executed
  • 1, if the command failed.

Another way of assigning database files is that of of having the CGI program setting up a temporary library list using the environment variable QIBM_CGI_LIBRARY_LIST, see the bottom of this page.
Use subprocedure putenv to set this environment variable.