Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is the difference between INCLUDE and COPY?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: What is the difference between INCLUDE and COPY?
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts Image copy after Online reorganization. lind sh IMS DB/DC 0 Tue Jan 30, 2018 9:58 pm
No new posts Copy Specific Groups V S Amarendra Reddy SYNCSORT 10 Thu Jan 11, 2018 1:16 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us