View previous topic :: View next topic
|
Author |
Message |
mainframesiva
New User
Joined: 01 Jan 2020 Posts: 3 Location: India
|
|
|
|
Is there any difference between using include and copy while declaring the copybooks? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2137 Location: USA
|
|
|
|
Try to google the keywords:
“Difference cobol copy include” |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Welcome!
<Copied from Internet>
A.COPY
Any Source code statements that you want to use in multiple places can be kept in COPYBOOK. This can be included in main source program by issuing below statement.
A COPY statement can appear in the source text anywhere a character string or a separator can appear.
B.INCLUDE
The INCLUDE statement inserts declarations or statements into a source program.
Code: |
EXEC SQL
INCLUDE MEMBER
END-EXEC |
The member can contain any host language statements and any SQL statements other than an INCLUDE statement. In COBOL, INCLUDE member-name must not be specified in other than the DATA DIVISION or PROCEDURE DIVISION
1.So INCLUDE can also have just COBOL statements like COPY (Copybook) and can be used in place of COPY in a COBOL program.
2.Details in INCLUDE member is replaced at Precompile time while statements in COPY member are replaced in Compilation time.
3.REPLACING option can be used for COPY and not for INCLUDE |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2137 Location: USA
|
|
|
|
Does it make any sense to copy the whole parts of manuals, references, and user guides from widely available sources to this forum, just to satisfy those chairwarmers who are not able even to enter a Google search request, or are not able to read any book , or a computer game instruction?
Modified. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
sergeyken, Please refrain from commenting on Religion or God in any kind.
It totally make sense to me to not to disappoint or insult any new joiner when it is easy for us to post what is needed even if its manual link , Google Search or simple stuff. Once TS familiarize how this forum works, We wouldn't see such posts as often as before. |
|
Back to top |
|
|
|