INCLUDE can only be embedded in a host language. INCLUDE is not an executable command and cannot be dynamically prepared.
No special authorization is needed for INCLUDE.
INCLUDE {SQLCA | SQLDA | member-name}
member-name | The member name (or file name) can contain any host language source statements or SQL statements, except the INCLUDE statement. In COBOL, the statement "INCLUDE member-name" must not appear anywhere other than the DATA DIVISION or the PROCEDURE DIVISION section. See your XDB Server precompiler documentation for specifics about the member-name parameter. |
Indicates an SQL communication area (SQLCA) description is to be included. Do not specify INCLUDE SQLCA more than once in the same application program. See XDB Server SQL Communications Area (SQLCA) for more information about the SQLCA.
Indicates an SQL descriptor area (SQLDA) description is to be included. See XDB Server SQL Descriptor Area (SQLDA) for more information about the SQLDA.
The file must reside in the directory specified by the environment variable COBCPY (Micro Focus) or SYSLIB (CA-Realia II). The XDB Server precompiler looks for the file extensions .CPY and .CBL if the XDBCPY directive is active. With CA-Realia II, the XDB Server precompiler looks for the .COB extension by default. Consult your XDB Server precompiler documentation for further details.
EXEC SQL INCLUDE emprec END-EXEC
Description
The INCLUDE statement is used to bring external files (containing either data definitions or segments of program code that must be precompiled) into an application. When precompiled, the INCLUDE statement is replaced by the source statements. The INCLUDE statement must therefore be specified at a point in the application program where the resulting source statements are accepted by the compiler. The INCLUDE statement cannot introduce source statements that themselves contain INCLUDE statements. Depending on the host language used, INCLUDE can also identify SQL communication and descriptor areas.