Rational Developer for System z
COBOL for Windows バージョン 7.5 プログラミング・ガイド


例: ODBC データ定義用のコピーブック

以下のサンプルでは、メッセージ・テキストや戻りコードなどの項目に対するデータ定義を示しています。

******************************************************************
* 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     *
*************************

ご利用条件 | フィードバック

Copyright IBM Corporation 1996, 2008.
このインフォメーション・センターでは Eclipse テクノロジーが採用されています。(http://www.eclipse.org)