IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can I include my COPY Book?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Tue Feb 17, 2004 8:51 pm
Reply with quote

How can I include my COPY Book? Is there any special routines for that....
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Feb 18, 2004 12:17 am
Reply with quote

Hi priya,

If it's a COBOL copybook you code:

COPY my_copybook_member_name

in your pgm in a line where you would have coded the stmts if you were NOT using a copybook.

Remember that a copybook can contain executable COBOL stmts; you would code that in the PROC DIV.

Check your compile JCL to determine in which PDC your copybooks should reside. I think it's the SYSLIB DD stmt.

There's also a global change facility that allows you to change data name prefixes, etc. for each use of the copybook with a COPY stmt, e.g.:

01 abc-field1 .... from COPY stmt #1
.
.
01 abc-field6 ....
.
.
.
01 xyz-field1 ... from COPY stmt #2
.
.
01 xyz-field6 ....

HTH, Jack.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Wed Feb 18, 2004 2:57 pm
Reply with quote

So far I can remember, if it is a procedure division copybook and contains executable statements then we should code INCLUDE and not COPY because it will be first PRECOMPILED and then COMPILED. INCLUDE is expanded in precompilation time and copy in compilation time. So if you code COPY in procure division then it will not be compiled properly.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Feb 19, 2004 9:58 am
Reply with quote

Hi Sandip,

I've always used Copy for PD stmts. But you may be right if the stmts contain DB2 code.

Regards, Jack.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Thu Feb 19, 2004 2:13 pm
Reply with quote

Hi Jack,

I think for CICS code will create the same problem...in fact copybook containing precompilable statements like EXEC CICS or EXEC SQL will cause problem.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top