Use the SQLDBS routine to call DB2 APIs with the following syntax:
CALL SQLDBS 'command string'
For information on how the DB2 APIs work, see the complete descriptions in the DB2 API chapter of the Administrative API Reference.
If a DB2 API you want to use cannot be called using the SQLDBS routine (and consequently, not listed in the Administrative API Reference), you may still call the API by calling the DB2 command line processor (CLP) from within the REXX application. However, since the DB2 CLP directs output either to the standard output device or to a specified file, your REXX application cannot directly access the output from the called DB2 API nor can it easily make a determination as to whether the called API is successful or not. The SQLDB2 API provides an interface to the DB2 CLP that provides direct feedback to your REXX application on the success or failure of each called API by setting the compound REXX variable, SQLCA, after each call.
You can use the SQLDB2 routine to call DB2 APIs using the following syntax:
CALL SQLDB2 'command string'
where 'command string' is a string that can be processed by the command-line processor (CLP). Refer to the Command Reference for the syntax of strings that can be processed by the CLP.
Calling a DB2 API using SQLDB2 is equivalent to calling the CLP directly, except for the following:
Since the only REXX variable that is set after you call SQLDB2 is the SQLCA, you only use this routine to call DB2 APIs that do not return any data other than the SQLCA and that are not currently implemented through the SQLDBS interface. Thus, only the following DB2 APIs are supported by SQLDB2:
Notes on DB2 APIs Supported by SQLDB2:
Note: | Although the SQLDB2 routine is intended to be used only for the DB2 APIs listed above, it can also be used for other DB2 APIs that are not supported through the SQLDBS routine. Alternatively, the DB2 APIs can be accessed through the CLP from within the REXX application. |