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.12 Sample Codings Using the REGISTER-VARYING-INDICATOR Method

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

 IDENTIFICATION DIVISION.
 PROGRAM-ID BIND4-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 set in the bind table.
 01 ELM-NO   PIC  S9(9) COMP-5.
       :
*Define bind table variables.
 01 GET-DATA.
     02 GET-DATA-LEN PIC S9(4) COMP-5.
     02 GET-DATA-DAT PIC X(256).
 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-VARYING-INDICATOR"
                    USING GET-DATA-LEN  GET-DATA-DAT INDICATOR.
       :
* Collect the object.
     SET BIND-A TO NULL.
       :
 END PROGRAM BIND4-APL.

Contents Index PreviousNext

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