SQL Supplement for H-Series RVUs

SQL/MP Programming Manual for COBOL
HP NonStop SQL Supplement for H-Series RVUs529446-005
1-26
Running the HP COBOL Compilers
Running the cobol Utility in the OSS Environment
The OSS utility cobol generates COBOL programs that run in the OSS environment
of TNS or TNS/R systems. The cobol utility invokes the HP COBOL compiler,
COBOL85, optionally followed by the Binder, Accelerator, and SQL compiler. The flags
and the types of files in the operands determine which processes operate on the files
in the operands.
Text file inputs to the compiler can be OSS ASCII text files (code 180) or Guardian
EDIT files (code 101). Embedded SQL/MP source code can be in one of these OSS
file types (identified by the file suffix):
The command syntax for running the COBOL85 compiler in the OSS environment
follows. The cobol utility is case-sensitive. Bracketed items are optional. Put spaces
between flags and their parameters, but do not put spaces on either side of equal
signs.
For detailed information about the cobol utility, see the Open System Services Shell
and Utilities Reference Manual.
These examples show how to compile an embedded SQL/MP program by using the
cobol utility:
To compile, bind, and SQL compile an embedded SQL/MP program, use this type
of command:
cobol -o /usr/mydir/myprog -L /nonnative/usr/lib \
-Wcobol="SQL" -Wsql="catalog \$vol.subvol" mysrc.cbl
°
The -Wcobol flag directs the cobol utility to pass a string of compiler
directives to the COBOL85 compiler. In this case, the SQL directive tells the
Note. TNS mode compilation and execution are not supported in the OSS environment of
TNS/E systems. To compile a program in TNS mode on a TNS/E system, use the COBOL85
compiler in the Guardian environment. See Running the COBOL85 Compiler in the Guardian
Environment on page 1-20.
.cbl
.cob
COBOL source program to be compiled and optionally bound
.o Object file produced by a previous COBOL compilation to be passed directly to
the Binder
.a Archive, typically produced by the ar utility, of nonexecutable linkfiles to be
passed directly to the Binder
Note. Embedded SQL/MP programs are disallowed in user libraries, shared run-time libraries
(SRLs), and dynamic-link libraries (DLLs).
cobol [ flag [ flag ]... ] operand ...
Note. To terminate a compilation in the OSS environment, press the Control and c keys
(Ctrl-c) simultaneously.