The Embedded SQL precompiler translates Embedded SQL statements into COBOL data declarations and call statements. After precompiling, you can compile the resulting source program as you would any conventional COBOL program.
The precompiler processes your application in two passes. In the first pass, the precompiler parses the Embedded SQL statements and variable declarations, checking the syntax and displaying messages for any errors it detects. If the precompiler detects no severe errors, it proceeds with the second pass, wherein it does the following:
Adds declarations for the precompiler variables, which begin with “SQL--”. To prevent confusion, do not begin your variable names with “SQL”.
Converts the text of the original Embedded SQL statements to comments.
Generates stored procedures and calls to stored procedures if you set this option in the precompile command line.
Converts Embedded SQL statements to calls to runtime routines.
Generates up to three files: a target file, an optional listing file, and an optional isql script file.
For detailed descriptions of precompiler command line options,
see the Open Client and Open Server Programmer’s
Supplement.