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

COBOL Program Compilation
HP NonStop SQL/MX Programming Manual for C and COBOL523627-004
16-9
Running the SQL/MX COBOL Preprocessor
Embedded module definitions provide greater efficiency in the deployment of an
application to a production environment.
Running the SQL/MX COBOL Preprocessor
The SQL/MX COBOL preprocessor is available for these environments:
OSS
Microsoft Windows
Enterprise ToolKit—NonStop Edition (ETK)
The preprocessor for the OSS environment is installed when you install NonStop
SQL/MX on your system. You must install the Windows-hosted preprocessor on your
Windows workstation. For information, see the SQL/MX Installation and Management
Guide.
The syntax for using the preprocessor in each environment appears in Syntax for the
OSS-Hosted SQL/MX COBOL Preprocessor on page 16-13 and Syntax for the
Windows-Hosted SQL/MX COBOL Preprocessor on page 16-17.
Preprocessor Functions
The preprocessor processes COBOL and SQL source statements.
COBOL Source Statements
The preprocessor writes each COBOL source statement to the COBOL annotated
source file. The preprocessor parses the COBOL annotated source file only to the
extent necessary to detect scoping levels, host variable declarations, host variable
expressions, and embedded SQL statements.
COBOL Comments
The preprocessor ignores COBOL comments unless the comment specifies a name for
an SQL statement. You can use a comment to name an SQL statement explicitly. To
do so, precede the statement with a comment using this format:
* SQL statement_name = name [ comment-text ]
EXEC SQL sql_statement ... END-EXEC.
The name is an SQL identifier you are assigning as the name of sql_statement, and
comment-text is an optional comment that does not affect the assignment of the
name. The COBOL comment must use only one line and must immediately precede
the SQL statement.
Note. ETK is a GUI-based extension package to the Visual Studio .NET product. Use ETK to
edit, compile, build, and deploy applications written in a variety of programming languages and
with embedded SQL/MX. For more information, see ETK online help.