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
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

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