SQL/MP Programming Manual for COBOL85

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL85429326-004
6-44
SQL Program File
SQL Program File
An SQL program file has these versions:
This section describes the HOSV and its relationship to the COBOL85 compiler and
SQL compiler. For more information about the PFV and PCV, see the SQL/MP Version
Management Guide.
The COBOL85 compiler generates the HOSV and stores the value in the object file.
If multiple object files are bound together in a single target object file, the HOSV of the
target object file is the newest (maximum) HOSV of the individual object files. For
example, if an object file with an HOSV of 2 and another object file with an HOSV of
310 are bound into a new target object file, the HOSV of the target object file is 310.
To return the HOSV of a program object file, use the GET VERSION OF PROGRAM
statement with the HOST OBJECT option. You can execute this statement from SQLCI
or embedded in a COBOL program. This GET VERSION OF PROGRAM statement is
executed from SQLCI:
GET HOST OBJECT VERSION OF PROGRAM sqlprog;
VERSION: 310
--- SQL operation complete.
To embed a static GET VERSION OF PROGRAM statement in a COBOL program,
you must include the INTO clause with a host variable. This statement returns the
HOSV of SQLPROG to the host variable named HV-HOSV:
EXEC SQL
GET HOST OBJECT VERSION OF PROGRAM SQLPROG INTO :HV-HOSV
END-EXEC.
Version Description
Host object SQL version (HOSV) The version of the COBOL85 compiler used to compile
the program. Generated by the COBOL85 compiler
and therefore is the same as the host SQL version
(HSV) of the compiler.
Program format version (PFV) The version of the SQL compiler used to compile the
program and the oldest version of an SQL executor
that can execute the program. Generated by the SQL
compiler.
Program catalog version (PCV) The oldest version of an SQL catalog in which the
program can be registered. Generated by the SQL
compiler.