SQL in a copybook

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

SQL in a copybook

Postby smaartchap » Fri Jun 26, 2009 5:24 pm


I have a SQL query (that calls a stored proc) in a copybook. In a particular paragraph I gave "COPY <copybook name>" and it compiled fine.

My doubt is - The SQL statements should be INCLUDed and not COPYed.
Can you please explain how the pre-compiler is able to expand the query even though it is used with COPY statement.

Thanks in advance,
Posts: 2
Joined: Fri Jun 26, 2009 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SQL in a copybook


Re: SQL in a copybook

Postby dick scherrer » Sat Jun 27, 2009 1:41 am


Suggest you look at how the pre-compiler and the compiler handled the copybook.

If you see something in those outputs that is not clear, post the unclear piece(s) here and someone should be able to clarify.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Return to IBM Cobol


  • Related topics
    Last post