SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)
C/C++ Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL—544617-003
15-59
Building SQL/MX Guardian Applications in the
Guardian Environment
Building SQL/MX Guardian Applications in the Guardian
Environment
•
Using the OSS Pass-Through Command on page 15-59
•
OSS-to-Guardian File Naming on page 15-59
•
Steps for Building an SQL/MX C Application in the Guardian Environment on
page 15-60
•
Using a TACL Macro to Build a C Guardian Application on page 15-61
•
Steps for Building an SQL/MX C++ Application in the Guardian Environment on
page 15-62
•
Using a TACL Macro to Build a C++ Guardian Application on page 15-63
Using the OSS Pass-Through Command
Most commands for building an SQL/MX Guardian application can issued directly at a
TACL prompt. However, the SQL/MX preprocessor, mxsqlc, and the SQL/MX
compiler, mxcmp, are OSS commands, which run only from OSS. Although mxcmp
resides in the Guardian environment, it runs as an OSS process and must be started in
the OSS environment.
To run the SQL/MX preprocessor and the SQL/MX compiler in the Guardian
environment, use the OSS pass-through command by specifying the osh -c option.
The osh -c option executes one command line at a time in the OSS environment.
When you use the osh -c command, remember to enclose the entire command string
after osh -c in double quotes.
OSS-to-Guardian File Naming
When you issue OSS commands from a TACL prompt to preprocess and SQL compile
an application, the Guardian file names change automatically. In the Guardian
environment, the period is automatically dropped from the file name.
For example, this OSS pass-through command preprocesses a C source file and
generates an annotated source file and module definition file in the Guardian
environment:
TACL> osh -c "mxsqlc prog.sql -c prog.c -m prog.m"
The annotated source file and module definition file in $MYVOL.MYSUBVOL are
PROGC and PROGM. Be aware of the Guardian file name limitation of eight characters.
Note. When using OSS pass-through commands in the Guardian environment, be aware of
the effect of #INFORMAT TACL on those commands. If #INFORMAT TACL is in effect for your
session, you must put a tilde (~) before the pipe (|) symbol. Otherwise, the pipe symbol cannot
reach the shell for execution because it has a programming function within TACL.










