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-46
Building SQL/MX Guardian Applications in the
Guardian Environment
3. To invoke the SQL/MX compiler, which is an OSS process, enter an OSS pass-
through command at a TACL prompt:
TACL> osh -c "/G/system/system/mxcmp progm |tee templog"
4. Errors generated by the SQL/MX preprocessor or SQL/MX compiler are logged in
the OSS file templog. To convert the error log to a Guardian file:
TACL> purge proglog
TACL> ctoedit templog,proglog
5. Run the Guardian COBOL compiler and linker.
For TNS/E native compilation:
== Convert the annotated source file from an OSS text file
== (file code 180) to a Guardian text file (file code 101).
TACL> ctoedit progcbl,progsrc
== Call the ECOBOL compiler to generate the object file.
TACL> ecobol /in progsrc,out progout/progo; &
consult $system.system.esqlclio
== Call the eld linker to generate an executable file.
TACL> eld -lzcobdll -lzcredll -lzclidll progo &
-o progexe
For TNS/R native compilation:
== Convert the annotated source file from an OSS text file to
== a Guardian text file.
TACL> ctoedit progcbl,progsrc
== Call the NMCOBOL compiler to generate the object file.
TACL> nmcobol /in progsrc,out progout/progo; &
consult $system.system.sqlclio
== Call the nld linker to generate an executable file.
TACL> nld -lzcobsrl -lzcresrl -lzclisrl progo &
-o progexe
6. Execute the executable:
TACL> run progexe
Using a TACL Macro to Build an SQL/MX Guardian
Application
Use a TACL macro file to combine and execute the commands. Use these sample
TACL macros to customize your own script. In the samples, the source file is located in
the Guardian environment and named progecob. Remember that the source file must
be Guardian file code 101.
For TNS/E 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.










