SQL/MP Programming Manual for COBOL

Explicit Program Compilation
HP NonStop SQL/MP Programming Manual for COBOL529758-003
6-19
Running HP COBOL Compilers in the OSS
Environment
To invoke the Binder program to bind object files into a program file and then
invoke the SQL/MP compiler to SQL compile the program file, use this command:
cobol -o myprog -L /nonnative/usr/lib
-Wbind="set heap_max 64" -Wsql x.o y.o z.o
The -Wbind flag directs the cobol utility to pass arguments to the Binder. In the
previous example, the Binder sets the maximum heap size to 64 pages. For more
information, see the Binder Manual.
Running the nmcobol Utility in the OSS Environment
The OSS utility nmcobol generates native COBOL programs that run in the OSS
environment of TNS/R systems. The nmcobol utility invokes the native HP COBOL
compiler, NMCOBOL, optionally followed by the linker 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 NMCOBOL compiler in the OSS environment
follows. The nmcobol 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 on the nmcobol 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
nmcobol utility:
Note. Run the Binder program before SQL compiling the program.
.cbl
.cob
COBOL source program to be compiled and optionally linked
.o Object file produced by a previous COBOL compilation to be passed directly to
the linker
.a Archive, typically produced by the ar utility, of nonexecutable linkfiles to be
passed directly to the linker
Note. Embedded SQL/MP programs are disallowed in user libraries, shared run-time libraries
(SRLs), and dynamic-link libraries (DLLs). When compiling embedded SQL/MP programs, do
not use the -Wshared flag, which produces a DLL.
nmcobol [ flag [ flag ]... ] operand ...
Note. To terminate a compilation in the OSS environment, press the Control and c keys
(Ctrl-c) simultaneously.