SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
COBOL Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
16-42
Building SQL/MX Guardian Applications in the OSS
Environment
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/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 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/".