SQL/MP Programming Manual for COBOL85
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
6-1
6 Explicit Program Compilation
This section describes the explicit compilation of a COBOL program containing
embedded SQL statements and directives in the Guardian and OSS environments
using TNS/R compilation tools.
The Compilation Method
Following are the steps for compiling a COBOL program that contains embedded SQL
statements and directives. The steps are shown in Figure 6-1 on page 6-2 and
described in detail on subsequent pages in this section.
1. Add any required class MAP or class CATALOG DEFINEs.
2. Run the COBOL85 or NMCOBOL compiler and specify a source file as input. Your
compilation unit must include the SQL compiler directive and an SQLCODE
variable declaration (either declared explicitly or implicitly with the INCLUDE
SQLCA directive).
3. If necessary, use the Binder or nld program to combine the COBOL object file with
other object files.
4. Optionally, run the Accelerator on the COBOL object file to optimize the object file
on a TNS/R system,
5. Run the SQL compiler (SQLCOMP) to compile the SQL source statements in the
COBOL object file and to validate the output SQL program file for execution. You
can then execute the SQL program file either interactively by using the TACL RUN
(or RUND) command or the OSS cobol utility, or programmatically by using the
COBOL CREATEPROCESS routine.