TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

266 Chapter6
Host Language Access
COBOL II
COBOL II
The model program presented at the beginning of this chapter is now shown here in
COBOL II. The program performs specific tasks to illustrate the use of TurboIMAGE/XL
intrinsics. Note that the code, although broken out by task, can be combined to make up a
complete, executable program.
Data items are defined at the beginning of the sample program. The parameters for the
TurboIMAGE/XL intrinsics are defined in the data division, and their values are defined
when the procedure is called or, in some cases, after it is executed.
The database identifier is described as follows:
01 DBNAME.
05 BASEID PIC X(02).
05 BASENAME PIC X(06).
05 TERMINATOR PIC X(02).
To access a database catalogued in a group other than the user's log-on group, the
database name must be followed by a period and the group name, for example,
ORDERS.GROUPX. If the database is in an account other than the user's account, the group
name must be followed by a period and the account name, for example,
ORDERS.GROUPX.ACCOUNT1.
Once the database has been opened and the database identifier has been moved to the first
halfword of the element (as shown in "Opening the Database"), it remains the same for all
subsequent calls illustrated.
The status record is defined in the same way for all tasks but its content varies depending
upon which procedure is called and the results of that procedure. The status record is
defined as follows:
01 STATUS1.
05 CONDITION PIC S9(4) COMP.
05 LENGTH1 PIC S9(4) COMP.
05 RECORD-NUMBER PIC S9(9) COMP.
05 CHAIN-COUNT PIC S9(9) COMP.
05 BACK-POINTER PIC S9(9) COMP.
05 FORWARD-POINTER PIC S9(9) COMP.
NOT-USED-PARM appears as a reminder when a parameter is not used by a procedure
performing the task being illustrated. NOT-USED-PARM is defined in this program as
follows:
01 NOT-USED-PARM-16 PIC S9(4) COMP.
01 NOT-USED-PARM-32 PIC S9(9) COMP.
NOTE
Because the Schema Processor, DBSCHEMA, upshifts alphabetic characters,
programs must specify data set and data item names in all uppercase
characters. Take note of this because COBOL II does not require that you use
uppercase characters.
For information on TurboIMAGE/XL data item lengths and type designators, refer to