View previous topic :: View next topic
|
Author |
Message |
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
How can I include my COPY Book? Is there any special routines for that.... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
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 |
|
|
|