Technical data
1.4 Compiling an HP COBOL DML Program
Your database administrator (DBA) creates schema and subschema definitions in
Oracle CDD/Repository. These record definitions are defined in DMU format and
are intended to serve all OpenVMS languages that might access them. In this
format, the record definitions are not compatible with COBOL record definitions.
Therefore, when the HP COBOL compiler retrieves the subschema definition from
Oracle CDD/Repository, it translates the file into an internal form acceptable to
the HP COBOL compiler.
If the translation results in compiler errors, they will probably be fatal.
You should alert your DBA to any errors resulting from a DB statement.
You can define the logical name CDD$DEFAULT as the starting schema node
in Oracle CDD/Repository. There is only one logical name translation in the DB
statement for schema-name. If you do not define it, CDD$TOP is the default.
Note
You must recompile an HP COBOL DML program each time the
subschema referenced by a DB statement is created. At compile time, the
date and time of subschema creation (date and time stamps) are included
with the translated subschema record definitions. If you do not recompile,
your program will receive a fatal error at run time.
1.4.1 Copying Database Records in an HP COBOL Program
A separately compiled HP COBOL database program must include the SUB-
SCHEMA SECTION header and only one DB statement. The compiler copies and
translates the record, set, and realm definitions in the subschema named by the
DB statement into compatible HP COBOL record definitions. You will not see any
database record definitions listed immediately following the DB statement. The
translated record, set, and realm definitions are only in the compiler’s subschema
map listing. To list these definitions in your program listing, use the /MAP
compiler command line qualifier.
1.4.2 Using the /MAP Compiler Qualifier
Use the /MAP compiler qualifier to generate a subschema map containing a
translated subschema listing. Section 7.3 contains two subschema map listings
on Alpha and I64 and two on VAX and explains how to read them. The following
example compiles DBPROG and creates a listing that includes a subschema map:
$ COBOL/LIST/MAP DBPROG
1.5 Linking an HP COBOL DML Program
HP COBOL DML programs must be linked with the shareable Oracle CODASYL
DBMS Library (SYS$LIBRARY:DBMDML/OPT). This library was created as part
of the Oracle CODASYL DBMS installation procedure. Therefore, to link an HP
COBOL DML object program named DMLPROG.OBJ with the shareable Oracle
CODASYL DBMS Library, you use this DCL command:
$ LINK DMLPROG,SYS$LIBRARY:DBMDML/OPT
Program Organization and Structure 1–5