Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Example: copybook for ODBC data definitions

The following example shows ODBC data definitions for items such as message text and return codes.

******************************************************************
* ODBC3D.CPY                 (ODBC Ver 3.0)                      *
*----------------------------------------------------------------*
* Data definitions to be used with sample ODBC function calls    *
*  and included in Working-Storage or Local-Storage Section      *
******************************************************************
* ODBC Handles
 01  Henv                       POINTER            VALUE NULL.
 01  Hdbc                       POINTER            VALUE NULL.
 01  Hstmt                      POINTER            VALUE NULL.
* Arguments used for GetDiagRec calls
 01  DiagHandleType             COMP-5  PIC 9(4).
 01  DiagHandle                 POINTER.
 01  DiagRecNumber              COMP-5  PIC 9(4).
 01  DiagRecNumber-Index        COMP-5  PIC 9(4).
 01  DiagSQLState.
     02 DiagSQLState-Chars              PIC X(5).
     02 DiagSQLState-Null               PIC X.
 01  DiagNativeError            COMP-5  PIC S9(9).
 01  DiagMessageText                    PIC X(511) VALUE SPACES.
 01  DiagMessageBufferLength    COMP-5  PIC S9(4)  VALUE 511.
 01  DiagMessageTextLength      COMP-5  PIC S9(4).
* Misc declarations used in sample function calls
 01  SQL-RC                     COMP-5  PIC S9(4)  VALUE 0.
 01  Saved-SQL-RC               COMP-5  PIC S9(4)  VALUE 0.
 01  SQL-stmt                           PIC X(30).
*************************
* End of ODBC3D.CPY     *
*************************

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)