SQL Supplement for H-Series RVUs

SQL/MP Programming Manual for COBOL
HP NonStop SQL Supplement for H-Series RVUs529446-005
1-11
Compilation Methods
To compile a COBOL program that contains embedded SQL statements and directives
for execution on a TNS/E system:
1. Add any required class MAP or class CATALOG DEFINEs.
2. Run the ECOBOL compiler and specify a source file as input.
Your compilation unit must include an SQLCODE variable declaration (either
declared explicitly or implicitly with the INCLUDE SQLCA directive). You must
specify the SQL compiler directive on the compiler command line.
3. If necessary, use the eld utility to combine the COBOL object file with other object
files.
4. Run the SQL compiler (SQLCOMP) to compile the SQL source statements in the
COBOL object file and to produce a valid SQL program file for execution.
The SQL program file that is produced can be executed in either the OSS or Guardian
operating environment, depending on how you compile the program:
In the Guardian environment, execute the SQL program file, either interactively by
using the TACL RUN (or RUND) command or programmatically by using the
COBOL CREATEPROCESS or CLU_PROCESS_CREATE_ routine.
In the OSS environment, add the directory of the SQL program file to your search
path by using the export command and then execute the SQL program file by
entering its name at an OSS prompt.
For more information, see Section 7, “Program Execution,” of the SQL/MP
Programming Manual for COBOL.