An SQL INCLUDE statement is treated identically to a native COBOL COPY statement (including the search path and the file extensions used) when you use the SQL compiler option.
The following two lines are therefore treated the same way. (The period that ends the EXEC SQL INCLUDE statement is required.)
EXEC SQL INCLUDE name END-EXEC. COPY name.
The name in an SQL INCLUDE statement follows the same rules as those for COPY text-name and is processed identically to a COPY text-name statement that does not have a REPLACING phrase.
COBOL does not use the DB2 environment variable DB2INCLUDE for SQL INCLUDE processing. However, if you use the standard DB2 copybooks, there are no other settings that you must make. If the search rules call for using SYSLIB as the library-name, the compiler finds the copybooks by using the DB2 environment variable DB2PATH, which is set during DB2 installation, to extend the setting of SYSLIB to include the DB2 include directory. The SYSLIB string that is used is essentially %SYSLIB%;%DB2PATH%\INCLUDE\COBOL_A.
related references
Compiler-directing statements
COPY statement
(COBOL for Windows Language Reference)