Difference between INCLUE and COPY in the program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Difference between INCLUE and COPY in the program

Postby chetan_007 » Tue Oct 27, 2009 11:20 pm

Hi,

Both the entities, INCLUDE and COPY are used to expand the copy book.

eg:- Inside cobol program

-INC (copy book name)

or COPY (copy book name)

So what 's the difference between COPY and INCLUDE inside the program.

Plz let me know.

Tks in Adv.
chetan_007
 
Posts: 24
Joined: Sun Mar 02, 2008 3:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: Difference between INCLUE and COPY in the program

 

Re: Difference between INCLUE and COPY in the program

Postby dick scherrer » Wed Oct 28, 2009 12:23 am

Hello,

Both the entities, INCLUDE and COPY are used to expand the copy book.
Not quite. . .

Suggest you run a compile with a COPY for some copybook and INCLUDE for that same copybook.

INCLUDE is used by a pre-processor rather than the actual compile.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Difference between INCLUE and COPY in the program

Postby KMG » Fri Oct 30, 2009 2:26 pm

INCLUDE will read copybook dynamically where COPY makes STATIC call.

Explanation:
In case of INC, if you modify your copybook then there is no need to re-compile your program .
Regards, KMG
KMG
 
Posts: 3
Joined: Fri Oct 30, 2009 2:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Difference between INCLUE and COPY in the program

Postby dick scherrer » Fri Oct 30, 2009 11:36 pm

Hello,

Possibly the most incorrect reply posted anywhere in our forum. . . :(

Why do you believe either include or copy has anything to do with "static"?

Why do you believe that a copybook can be changed and not require a re-compile?

Possibly, i completely misunderstand something. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Difference between INCLUE and COPY in the program

Postby Anuj Dhawan » Tue Nov 03, 2009 8:29 pm

COPY is opened by COBOL compiler.
++INCLUDE is a Panvalet command to include data into a source library.
INCLUDE is opened by DB2 pre-processor.
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post