SQL/MP Programming Manual for COBOL85
Error and Status Reporting
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
9-2
Generating Structures With Different Versions
version
is the version number of the generated data structures; version can be 1, 2,
300, or later.
{ SQLCA | SQLSA } [ EXTERNAL ]
specifies that the structures are declared as external, making it possible to share
them among subprograms of the main program.
As a result, the SQLCA object or the SQLSA object can be referenced by any
subprogram in the main program that describes the object. All such descriptions
must be identical, or the results of the references are unpredictable. References to
an external object from different programs are always to the same object. In the
main program, there is only one representation of an external object. The storage
associated with that object is associated with the main program rather than with
any particular program within it.
Generating Structures With Different Versions
You can generate SQL structures that are all the same version or structures of different
versions. For example, to generate all version 310 structures in a program, specify this
directive:
EXEC SQL INCLUDE STRUCTURES ALL VERSION 310 END-EXEC.
Or, to generate different versions for each structure, specify this directive:
EXEC SQL INCLUDE STRUCTURES
SQLCA VERSION 2
SQLSA VERSION 2
SQLDA VERSION 310
END-EXEC.
Checking the Version of the COBOL85 Compiler
If you try to compile a COBOL program that uses the INCLUDE STRUCTURES
directive to specify a later version of a structure than the COBOL85 compiler can
generate, the compiler returns SQL error 11203. To determine the version of the
COBOL85 compiler before you compile a program, run the VPROC program for the
COBOL85 compiler object file. Then, check the version in the VPROC line that
contains S7094, which is the SQL compiler interface (SCI) product number.
When you compile the program, you can specify the SQLMAP option in the SQL
compiler directive. The SQLMAP option directs the COBOL85 compiler to include the
host object SQL version (HOSV) in the map at the end of the source-file listing. For
example, a version 310 COBOL85 compiler listing includes this line:
Host Object SQL Version = 310
For more information about versions of NonStop SQL/MP, see the SQL/MP Version
Management Guide.