Technical data

IDENTIFICATION DIVISION.
PROGRAM-ID. MULTI-STREAM-1.
DATA DIVISION.
SUB-SCHEMA SECTION.
DB PARTS1 WITHIN PARTS FOR "NEW.ROO" THRU STREAM-1.
.
.
.
CALL MULTI-STREAM-2
.
.
.
END PROGRAM MULTI-STREAM-1.
IDENTIFICATION DIVISION.
PROGRAM-ID. MULTI-STREAM-2.
DATA DIVISION.
SUB-SCHEMA SECTION.
DB DEFAULT_SUBSCHEMA WITHIN PARTS FOR "NEW.ROO" THRU STREAM-2.
.
.
.
CALL MULTI-STREAM-3.
EXIT PROGRAM.
IDENTIFICATION DIVISION.
PROGRAM-ID. MULTI-STREAM-3.
DATA DIVISION.
SUB-SCHEMA SECTION.
DB OLDPARTS1 WITHIN OLDPARTS FOR "OLD.ROO" THRU "STREAM-3".
.
.
.
EXIT PROGRAM.
In this run unit, the main program (MULTI-STREAM-1) accesses the database
NEW.ROO through STREAM-1 and performs a call to a subprogram. The
subprogram (MULTI-STREAM-2) accesses another subschema to the database
NEW.ROO through STREAM-2 and calls another subprogram. This subprogram
(MULTI-STREAM-3) accesses a second database (OLD.ROO) through STREAM-3.
STREAM-1, STREAM-2, and STREAM-3 are stream names. Stream names
assign a character string name to the database/subschema combination you
specify in your DB statement. For more information, refer to the HP COBOL
Reference Manual and the Oracle CODASYL DBMS documentation.
5.3 Using Oracle CDD/Repository
Oracle CODASYL schemas, storage schemas, and subschemas are stored in
Oracle CDD/Repository. Oracle CDD/Repository separates data descriptions from
actual data values that reside in VMS files. (For more information, refer to the
Oracle CODASYL DBMS documentation on Common Data Dictionary Utilities
and the Oracle CDD/Repository documentation.) Because of this separation,
HP COBOL DML programs can be written independently of data. In addition,
several subschemas can describe the same data according to their particular
needs. This eliminates the need for redundant data and ensures data integrity.
At compile time, the COBOL DB statement, in effect, references Oracle
CDD/Repository to obtain the data descriptions of a specific subschema. It
is not until run time that the COBOL program has access to the database data
values.
5–4 Database Programming with HP COBOL