What will be the result if DCLGEN is given with COPY statement and not INCLUDE?

The main difference between INCLUDE and COPY statement is the PDS member with INCLUDE statement is expanded during pre-compilation while the PDS member with COPY statement is expanded during compilation.

Since the DCLGEN member contains column names of the table (table structure) it is necessary to expand it during the pre-compilation. This is because at the time of precompilation all the SQL statements are validated, placed in DBRM and finally replaced by appropriate COBOL calls.

If the DCLGEN members are given with COPY statement instead of INCLUDE statement, then it will result in DB2 warnings during pre-compilation as the pre-compiler would not be able to validate the SQL statements in COBOL-DB2 program.

Updated on: 14-Sep-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started