Was this helpful?
Command Line Operations
This section describes the operations you must perform from the operating system command line in order to create an executable image of an embedded SQL program. These operations include preprocessing the embedded program and compiling the generated code.
esqlcbl Command – Invoke Embedded SQL Preprocessor for COBOL
The following command line invokes the COBOL preprocessor:
esqlcbl {flags} {filename}
where flags are:
 
Flag
Description
 
-d
Adds debugging information to the runtime database error messages embedded SQL generates. The source file name, line number and statement in error are printed with the error message.
 
-f[filename]
Writes preprocessor output to the named file. If no filename is specified, the output is sent to standard output, one screen at a time.
 
-l
Writes preprocessor error messages to the preprocessor's listing file, as well as to the terminal. The listing file includes preprocessor error messages and your source text in a file named filename.lis, where filename is the name of the input file.
 
-lo
Like -l, but the generated COBOL code also appears in the listing file.
 
-o.ext
Specifies the extension the preprocessor gives to both the translated include statements in the main program and the generated output files. If this flag is not provided the default is .cbl (Linux).
If you use this flag with the -o flag, then the preprocessor generates the specified extension for the translated include statements but does not generate new output files for the include statements.
 
-o
Directs the preprocessor not to generate output files for include files.
This flag does not affect the translated include statements in the main program. The preprocessor will generate a default extension for the translated include file statements unless you use the -o.ext flag.
 
-s
Reads input from standard input and generates COBOL code to standard output. This is useful for testing statements you are not familiar with. If the -l option is specified with this flag, the listing file is called "stdin.lis." To terminate the interactive session, type CtrlD (Linux).
 
-sqlcode
Indicates the file declares an integer variable named SQLCODE to receive status information from SQL statements. That declaration need not be in an exec sql begin/end declare section. This feature is provided for ISO Entry SQL92 conformity. However the ISO Entry SQL92 specification describes SQLCODE as a "deprecated feature" and recommends using the SQLSTATE variable.
 
-nosqlcode
Tells the preprocessor not to assume the existence of a status variable named SQLCODE. The -nosqlcode flag is the default.
 
-w
Prints warning messages.
 
-wopen
This flag is identical to -wsql= open. However,-wopen is supported only for backwards capability. See -wsql = open for more information.
 
-wsql= entry_SQL92
Causes the preprocessor to flag any usage of syntax or features that do not conform to the ISO Entry SQL92 entry level standard. (This is also known as the FIPS flagger option.)
 
-wsql=open
Use open only with OpenSQL syntax. -wsql = open generates a warning if the preprocessor encounters an embedded SQL statement that does not conform to OpenSQL syntax. (For OpenSQL syntax, see the OpenSQL Reference Guide.) This flag is useful if you intend to port an application across different Enterprise Access products. The warnings do not affect the generated code and the output file may be compiled. This flag does not validate the statement syntax for any Enterprise Access product whose syntax is more restrictive than that of OpenSQL.
Windows
-?
Shows the command line options for esqlcbl.
Linux
--
Shows the command line options for esqlcbl.
 
The embedded SQL/COBOL preprocessor assumes that input files are named with the extension .scb.
To override this default, specify the file extension of the input file(s) on the command line. The output of the preprocessor is a file of generated COBOL statements with the same name and the extension .cbl.
If you enter only the command, without specifying any flags or a filename, a list of flags available for the command is displayed.
esqlcbl Command Options
The following table presents the command options available with esqlcbl.
Command
Comment
esqlcbl file1
Preprocesses "file1.scb" to file1.cbl
esqlcbl file2.xcb
Preprocesses "file2.xcb" to file2.cbl
esqlcbl -l file3
Preprocesses file3.scb to file3.cbl and creates listing file3.lis
esqlcbl -s
Accepts input from standard input
esqlcbl -ffile4.out file4
Preprocesses file4.scb to file4.out
esqlcbl
Displays a list of available flags
Last modified date: 08/14/2024