SQL/MX Programming Manual for C and COBOL (H06.10+, J06.03+)

COBOL Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL544617-003
16-45
Building SQL/MX Guardian Applications in the
Guardian Environment
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 COBOL source file and
generates an annotated source file and module definition file in the Guardian
environment:
TACL> osh -c "mxsqlco prog.ecob -c prog.cbl -m prog.m"
The annotated source file and module definition file in $MYVOL.MYSUBVOL are
PROGCBL and PROGM. Be aware of the Guardian file name limitation of eight
characters.
Steps for Building an SQL/MX Application in the Guardian
Environment
Use the next commands at a TACL prompt to preprocess, SQL compile, and compile
and link an SQL/MX COBOL program.
1. To make the source file in the Guardian environment accessible to an OSS
process, enter this command, replacing myvol.mysubvol with your default
Guardian volume and subvolume:
param home /G/myvol/mysubvol
The source file named progecob in $MYVOL.MYSUBVOL must be Guardian file
code 101.
2. To invoke the SQL/MX preprocessor, which is an OSS process, enter an OSS
pass-through command at a TACL prompt:
TACL> osh -c "mxsqlco progecob -c progcbl &
-m progm |tee templog"
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.