SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)
COBOL Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—544617-003
16-47
Building SQL/MX Guardian Applications in the OSS
Environment
osh -c "mxsqlco progecob -c progcbl -m progm &
~|tee templog"
== Call the SQL/MX compiler.
osh -c "/G/system/system/mxcmp progm ~|tee -a templog"
== Convert OSS text files (file code 180) to Guardian text files
== (file code 101).
sink [#purge proglog]
ctoedit templog,proglog
ctoedit progcbl,progsrc
== Call the ECOBOL compiler to generate the object file.
ecobol /in progsrc,out progout/progo; &
consult $system.system.esqlclio
== Call the eld linker to generate an executable file.
eld -lzcobdll -lzcredll -lzclidll progo -o progexe
== Execute the executable.
run progexe
For TNS/R native compilation:
?tacl macro
param home /G/myvol/mysubvol
== Store terminal information in file templog.
== The source file must be file code 101.
== Call the SQL/MX preprocessor.
osh -c "mxsqlco progecob -c progcbl -m progm &
~|tee templog"
== Call the SQL/MX compiler.
osh -c "/G/system/system/mxcmp progm ~|tee -a templog"
== Convert OSS text files to Guardian text files.
sink [#purge proglog]
ctoedit templog,proglog
ctoedit progcbl,progsrc
== Call the NMCOBOL compiler to generate the object file.
nmcobol /in progsrc,out progout/progo; &
consult $system.system.sqlclio
== Call the nld linker to generate an executable file.
nld -lzcobsrl -lzcresrl -lzclisrl progo -o progexe
== Execute the executable.
run progexe
Building SQL/MX Guardian Applications in the OSS
Environment
You can use the ecobol or nmcobol -Wsystype=guardian option to build an
SQL/MX Guardian application in the OSS environment. Follow these steps:
1. Create an embedded SQL/MX COBOL source file (for example, prog.ecob) in
the OSS environment.
If your source file contains COPY statements, “OSS ” must precede the system file
name of an OSS directory. Otherwise, the compiler assumes that referenced files
are the same type as -Wsystype, which is Guardian, and returns an error.
COPY TEXT-NAME OF "OSS /usr/ossdir/".










