SQL Supplement for H-Series RVUs
SQL/MP Programming Manual for COBOL
HP NonStop SQL Supplement for H-Series RVUs—529446-005
1-21
Running the HP COBOL Compilers
To compile an embedded SQL program, you must specify the SQL directive, which
tells the compiler to expect SQL statements in the compilation unit. If you do not
specify the SQL directive before the first Identification Division in the source program,
you must specify it on the compiler command line. For example, this SQL directive tells
the compiler to expect embedded SQL statements, to accept only version 1 features of
SQL/MP, and to include an SQL map in the listing file, $VOL1.SUBVOL.LST:
COBOL85 /IN MYSRC, OUT $VOL1.SUBVOL.LST/ MYPROG; SQL &
(RELEASE1, SQLMAP)
For the syntax of the SQL directive, see the SQL Compiler Directive on page 1-14.
When compiling an embedded SQL program using the COBOL85 compiler, you can
optionally use the SQLMEM directive to cause the compiler to declare SQL data
structures in either the Working-Storage Section or the Extended-Storage Section of
the program. For example, this command directs the compiler to declare SQL data
structures in the Extended-Storage Section:
COBOL85 /IN MYSRC/ MYPROG; SQL; SQLMEM EXT
For more information about the compiler directives, see the COBOL Manual for TNS
and TNS/R Programs.
When you run the COBOL85 compiler, it automatically invokes the BINSERV process
of the Binder program, which validates and resolves references to other programs or
routines and produces a single object file. To invoke the Binder program separately,
use BIND. For more information, see The Binder Program on page 1-33.
After compiling and binding the object file, you can optimize the TNS object file for
execution on a TNS/R system by invoking the Accelerator or optimize it for execution
on a TNS/E system by invoking the Object Code Accelerator (OCA). For more
information, see Acceleration of TNS HP COBOL Programs on page 1-36.
Lastly, you must run the SQL compiler to generate SQL object code in the program file.
For more information, see Running the SQL Compiler in the Guardian Environment on
page 1-39.
Note. Run the Binder program before SQL compiling the program.
Caution. Because the Accelerator or OCA invalidates SQL program files, run the Accelerator
or OCA before you explicitly SQL compile the program to avoid having to recompile.










