Difference between Copy and Include

3 posts / 0 new
Last post
Anonymous
Difference between Copy and Include

 

I see we use COPY and Include for copying copybooks
and piece of code.
 
Can anyone list out the difference between these two commands?
 
I have seen that for expanding cobol copybooks we are using
COPY command but for expanding DB2 related copybooks like
DCLGEN copybook or SQLCA copybook we use Include command.
 
What is the logic for doing this?
"; ; ; ;
Offline
Joined: 09/04/2011 - 17:08
If u r using a cobol+db2+cics
If u r using a cobol+db2+cics program the complilation will be done intially on db2 pre complier and cics translator and then cobol compilation takes place , but as we need to use SQLCA copybook for db2 which is a copy book and if we give COPY SQLCA as COPY command is a cobol command which gets expanded during cobol compilation only but as we r using the SQLCA variables in the program which cannot get expanded until precompilation and cics translation and cannot find its varaibles and gives complilation error, so we use INCLUDE command of db2 which expands the copybook during db2 pre compilation only as INCLUDE is a db2 command.
Anonymous
copy Vs Include

Copy :  With this statement , Copy book will expnand while compilation  time.

Include :  With this statement , Copy book will expnand while pre-compilation time .

Log in or register to post comments
Sponsored Listing