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

Create a bind table and register in such table a variable for handling data other than that in the variable-length and binary formats, and an indicator variable.

 IDENTIFICATION DIVISION.
 PROGRAM-ID BIND3-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  PIC X(5).
 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-INDICATOR" USING GET-DATA INDICATOR.
       :
*Collect the object.
     SET BIND-A TO NULL.
       :
 END PROGRAM BIND3-APL.

Contents Index PreviousNext

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