View previous topic :: View next topic
|
Author |
Message |
mahesh.yalavarty
New User
Joined: 28 Nov 2005 Posts: 2
|
|
|
|
What is the difference between INCLUDE and COPY? And where can they used? |
|
Back to top |
|
|
shivani_tech Warnings : 2 New User
Joined: 08 Jan 2006 Posts: 22 Location: UNITED KINGDOM
|
|
|
|
copy is used to copy from data division and environment division variable ,which already exists. in the program where we need it again
so it is advantageous as we dont need to define the variable again and again
whereas include is used to include the db2 tables which has to be used
in application programs.
this is the main difference otherwise they both work
same |
|
Back to top |
|
|
mubashir.surury
New User
Joined: 29 Sep 2005 Posts: 23 Location: Pune
|
|
|
|
Hi Mahesh,
INCLUDE Statement :
> The member mentioned is expanded during the precompilation process
> Used when u need to include data from any member which is related to
DB2(i.e. queries or cursors or any db2 sql commands)
COPY Statement :
> The member mentioned is expanded during compilation process.
> used to include DATA DIVISION AND PROCEDURE DIVISION fuctions which are non-SQL.
Hope that answers ur question.
Correct me if i am wrong. |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
In addition to previous replies----
FYI...
INCLUDE is not a COBOL statement. Its a statement for DB2 precompiler where as COPY is cobol statement and is an instruction for COBOL precompiler.
Sequence of compilation is:
1.DB2 Pre-compiler
2.COBOL Pre-Compiler
3.COBOL main compiler
Example of INCLUDE statement
EXEC SQL <---- note
INCLUDE SQLCA
END-EXEC. <---- note
Example of COPY statement
COPY <ABCXXXX>. |
|
Back to top |
|
|
|