SQL Supplement for H-Series RVUs

SQL/MP Programming Manual for COBOL
HP NonStop SQL Supplement for H-Series RVUs529446-005
1-29
Running the HP COBOL Compilers
the SQL Compiler Directive on page 1-14. The -Wsql flag also invokes the
-Wsqlcomp flag if you do not specify it on the command line.
°
The -Wsqlcomp flag directs the nmcobol utility to invoke the SQL/MP
compiler (SQLCOMP) after the linking step, passing the specified arguments to
the SQL/MP compiler. In this case, a catalog, $vol.subvol, is passed to the
SQL/MP compiler.
°
The -o flag directs the nmcobol utility to use the specified path name instead
of default a.out for the executable file produced.
By default, the nmcobol utility automatically invokes the nld utility to link object
files into a non-PIC object file (loadfile). To create a PIC program loadfile, use the
-Wcall_shared flag to invoke the ld utility:
nmcobol -o /usr/mydir/myprog -Wcall_shared -Wsql mysrc.cbl
You can optionally pass arguments to the ld utility using the -Wld or -Wld_obey
flag. For more information, see the ld Manual.
To suppress the invocation of the linker, use the -c or -Wnolink flag on the
nmcobol command line:
°
In this example, the -c flag directs the nmcobol utility to compile the specified
source file, mysrc.cob, but not to link it or remove the object file, mysrc.o,
that is created in the current directory:
nmcobol -c mysrc.cob
°
This command invokes the SQL/MP compiler to SQL compile the program file,
myprog, without invoking the linker:
nmcobol -Wnolink -Wsql myprog
To invoke the nld utility to link object files into a non-PIC program file and then
invoke the SQL/MP compiler to SQL compile the program file, use this command:
nmcobol -o myprog -Wsql x.o y.o z.o
The -Wnld or -Wnld_obey flag directs the nmcobol utility to pass arguments to
the nld utility. For more information, see the nld Manual.
Note. Do not use the -Wsql and -s flags in the same invocation of the nmcobol
utility. The -s option strips symbols information from the object file. The SQL compiler
requires the symbols region to be present for SQL compilation to succeed.
Note. Run the linker before SQL compiling the program.