DB Access Class Library for COBOL V1.0 API Reference - Microsoft(R) Windows(R) - - Microsoft(R) Windows NT(R) - - Microsoft(R) Windows(R) 2000 -
Contents Index PreviousNext

UpChapter 10 Sample Codings Using Methods Provided

10.13 Sample Codings Using the REGISTER-LARGE-DATA-INDICATOR Method

Create a bind table and register in such table a variable for handling data in the binary format, and an indicator variable.

 IDENTIFICATION DIVISION.
 PROGRAM-ID BIND5-APL.
 ENVIRONMENT DIVISION.
 CONFIGURATION SECTION.
 
*Specify the class name used in the program.
 REPOSITORY.
       :
     CLASS BINDTBL AS "*COB-BINDTABLE".
 
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 
*Define an object variable.
 01 BIND-A USAGE OBJECT REFERENCE BINDTBL.
       :
*Define a variable for setting a count of the number of items to be registered in the bind table.
 01 ELM-NO   PIC  S9(9) COMP-5.
       :
*Define bind table variables.
 01 GET-DATA.
     02 GET-DATA-RSV  PIC S9(9) COMP-5.
     02 GET-DATA-LEN  PIC 9(9) COMP-5.
     02 GET-DATA-DAT  PIC X(20000).
 01 INDICATOR PIC S9(4) COMP-5.
       :
 PROCEDURE DIVISION.
       :
*Set a count of the number of items to be set in the bind table.
     MOVE 1 TO ELM-NO.

*Create a bind table object.
     INVOKE BINDTBL "NEW" USING ELM-NO RETURNING BIND-A.
 
*Register a variable in the bind table.
     INVOKE BIND-A "REGISTER-LARGE-DATA-INDICATOR" 
                USING GET-DATA-RSV GET-DATA-LEN GET-DATA-DAT INDICATOR.
       :
*Collect the object.
     SET BIND-A TO NULL.
       :
 END PROGRAM BIND5-APL.

Contents Index PreviousNext

All Rights Reserved, Copyright (C) Alchemy Solutions Inc. 1998-2000