What is the difference between Include and Copy?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
s_maria
New Member
Posts: 3
Joined: Thu Oct 16, 2014 12:14 pm

What is the difference between Include and Copy?

Post by s_maria »

Hi,

What is the difference between Include and Copy? Can someone please explain that to me?

++include copybook
copy copybook
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What is the difference between Include and Copy?

Post by Robert Sample »

The ++include statement is a PANVALET statement and as such will only be recognized at sites that have purchased and use PANVALET. The COPY statement is a standard part of COBOL and will always be available. For more information about the differences, consult the PANVALET documentation (which is available to you if your site has a license for the product).

Note that the ++include statement is different from the COBOL INCLUDE statement, which is used by precompilers (such as DB2) to include code at the pre-compile stage rather than at compile time.
s_maria
New Member
Posts: 3
Joined: Thu Oct 16, 2014 12:14 pm

Re: What is the difference between Include and Copy?

Post by s_maria »

But we have INCLUDE used for SQL also. If we are using PANVALET, will there not be confusion for which INCLUDE is for what?
s_maria
New Member
Posts: 3
Joined: Thu Oct 16, 2014 12:14 pm

Re: What is the difference between Include and Copy?

Post by s_maria »

I forgot to tell that we use change-man.
AmjzadAli
Registered Member
Posts: 14
Joined: Sun Oct 26, 2014 7:54 pm

Re: What is the difference between Include and Copy?

Post by AmjzadAli »

s_maria wrote: Wed Sep 15, 2021 5:28 pm But we have INCLUDE used for SQL also. If we are using PANVALET, will there not be confusion for which INCLUDE is for what?
Both are different. Do not confuse them with each oterh.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What is the difference between Include and Copy?

Post by Robert Sample »

If we are using PANVALET, will there not be confusion for which INCLUDE is for what?
For PANVALET, the INCLUDE statement is preceded by ++ (which are NOT optional). If the INCLUDE does not have ++ on the front of it, then it is a COBOL or SQL INCLUDE statement, not a PANVALET statement. And since the syntax is ++INCLUDE <membername> where <membername> is the name of the member to be included, you cannot be confused about what is being included. Similarly, the COBOL INCLUDE will be SQLCA, SQLDA, or a member name. So there should be no confusion as to which INCLUDE is for what.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”