View previous topic :: View next topic |
Author |
Message |
ankusume4u Beginner
Joined: 26 May 2004 Posts: 5 Topics: 2
|
Posted: Sat Sep 04, 2004 6:39 pm Post subject: Difference between COBOL COPY and ++INCLUDE |
|
|
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 |
|
 |
sandip Beginner
Joined: 28 Jul 2004 Posts: 18 Topics: 3
|
Posted: Sun Sep 05, 2004 11:50 pm Post subject: |
|
|
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 |
|
 |
ankusume4u Beginner
Joined: 26 May 2004 Posts: 5 Topics: 2
|
Posted: Mon Sep 06, 2004 12:32 am Post subject: |
|
|
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 |
|
 |
sandip Beginner
Joined: 28 Jul 2004 Posts: 18 Topics: 3
|
Posted: Mon Sep 06, 2004 12:49 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
ankusume4u Beginner
Joined: 26 May 2004 Posts: 5 Topics: 2
|
Posted: Tue Sep 07, 2004 4:57 am Post subject: |
|
|
Thanks Kholusu |
|
Back to top |
|
 |
|
|