If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Using The Include Statement In Z/os Cobol-db2 ??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-06, 10:33
db2dcs db2dcs is offline
Registered User
 
Join Date: Feb 2005
Location: United States
Posts: 20
Using The Include Statement In Z/os Cobol-db2 ??

I have 1400 lines of COBOL code that contains embedded SQL statements.
The code needs to be re-used in at least two programs, and I therefore made it into a procedural copybook.

Because of the embedded SQL, a basic COPY statement would not compile, so I had to use the INCLUDE statement to get it to compile.
i.e.
EXEC SQL
INCLUDE copybook
END-EXEC.

The problem is that I also need to employ the REPLACING clause for this
copybook.
i.E. COPY copybook REPLACING ==(*)== BY ==EXT==.
However, I cannot get the REPLACING clause to be recognized in an INCLUDE statement. Does anyone know if it can be done ?? I know I could probably make this a called program, but there would be several complications if I do this, so for the time being, I am exploring the copybook approach.
We are a Z/OS shop with version 7 DB2.
Reply With Quote
  #2 (permalink)  
Old 03-24-06, 15:16
schintala schintala is offline
Registered User
 
Join Date: Apr 2005
Location: USA
Posts: 119
You can not use replace cobol reserved word with INCLUDE SQL statement. I would create another copy book with different name.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On