IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is the difference between INCLUDE and COPY?


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mahesh.yalavarty

New User


Joined: 28 Nov 2005
Posts: 2

PostPosted: Sat Mar 25, 2006 12:27 pm
Reply with quote

What is the difference between INCLUDE and COPY? And where can they used?
Back to top
View user's profile Send private message
shivani_tech
Warnings : 2

New User


Joined: 08 Jan 2006
Posts: 22
Location: UNITED KINGDOM

PostPosted: Sat Mar 25, 2006 12:35 pm
Reply with quote

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
View user's profile Send private message
mubashir.surury

New User


Joined: 29 Sep 2005
Posts: 23
Location: Pune

PostPosted: Mon Mar 27, 2006 5:32 pm
Reply with quote

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
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Tue Mar 28, 2006 2:15 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top