Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Location
    United States
    Posts
    22

    Unanswered: 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.

  2. #2
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    You can not use replace cobol reserved word with INCLUDE SQL statement. I would create another copy book with different name.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •