Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us