MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Difference between COBOL COPY and ++INCLUDE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ankusume4u
Beginner


Joined: 26 May 2004
Posts: 5
Topics: 2

PostPosted: Sat Sep 04, 2004 6:39 pm    Post subject: Difference between COBOL COPY and ++INCLUDE Reply with quote

Hi All,

I tried searching this before barging into "help boards" for help, i could not get a satisfactory answer for the difference between the usage of ++INCLUDE and COPY in a COBOL program.

Could anyone elaborate on the exact difference between these two in context of COBOL usage and not DB2 usage.

For example if i have a COBOL COPYBOOK, i can use it in my program by ++INCLUDing it or COPYing it, how does it matter which one i want to choose.

Help on this will be very much appreciated.

Ankush.
Back to top
View user's profile Send private message
sandip
Beginner


Joined: 28 Jul 2004
Posts: 18
Topics: 3

PostPosted: Sun Sep 05, 2004 11:50 pm    Post subject: Reply with quote

Hi Ankush,

As far as the working storage or FD section is concerned, COPY and ++INCLUDE doesn't have any difference.

But as far as Procedure Division is concerned,
If the copybook contains code like "EXEC SQL" or "EXEC CICS" (i.e., the code which needs to be precompiled), then you must use ++INCLUDE and not COPY because COPY expands in compile time and INCLUDE expands in precompile time.

Regards,
Sandip.
Back to top
View user's profile Send private message
ankusume4u
Beginner


Joined: 26 May 2004
Posts: 5
Topics: 2

PostPosted: Mon Sep 06, 2004 12:32 am    Post subject: Reply with quote

Hi Sandip,

Thanks for replying.

Actually looking at the previous discussions on this topic i could figure out the specific difference which you have stated.

Still i would like to know what difference it would make if i used ++INCLUDE or COPY to include\copy a COBOL copybook in pure COBOL sence (not DB2 or CICS). for example, Say i have a simple working storage COBOL copybook containing nothing but plain vanilla WS variables, is there any difference between COPYing it and INCLUDing it??

Help will be appreciated.

Thanks
Ankush
Back to top
View user's profile Send private message
sandip
Beginner


Joined: 28 Jul 2004
Posts: 18
Topics: 3

PostPosted: Mon Sep 06, 2004 12:49 am    Post subject: Reply with quote

As far as output of the program is concerned, there is no difference.
I think from efficiency point of view, I don't think that there will be any difference because, once compilation is made, there is nothing to do with source code.

Could anyone help us to represent assembly representation of COPY and INCLUDE?

but I am sure that if you use very old version fo COBOL, then COPY will not work, you have to rely on INCLUDE.

regards,
Sandip.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 06, 2004 6:23 am    Post subject: Reply with quote

ankusume4u,

Pzmohanty,

Please search before posting. This topic has been discussed earlier. Check this link.

http://www.mvsforums.com/helpboards/viewtopic.php?t=175&highlight=panavalet

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ankusume4u
Beginner


Joined: 26 May 2004
Posts: 5
Topics: 2

PostPosted: Tue Sep 07, 2004 4:57 am    Post subject: Reply with quote

Thanks Kholusu
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group