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

INCLUDE statement and a DCLGEN member name in COPY statement


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rameshvaamshy
Currently Banned

New User


Joined: 19 Aug 2007
Posts: 14
Location: bangalore

PostPosted: Mon May 19, 2008 6:31 pm
Reply with quote

What if we code a copybook name in INCLUDE statement and a DCLGEN member name in COPY statement? Please give me an idea.
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Mon May 19, 2008 7:19 pm
Reply with quote

Shouldn't have any problems IMO. You will have to include the cobol copylibs in the precompiler step and the dcllibs in the cobol step.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Tue May 20, 2008 10:01 am
Reply with quote

DCLGEN members need to be expanded during the Pre-Compilation as the variables declared in those members are placed in the COBOL code before the compilation. DCLGEN members are not used with the COPY option as the COPY expands the members during the Compile time.
Back to top
View user's profile Send private message
ermanisharora

New User


Joined: 10 Apr 2007
Posts: 7
Location: Good-gaon

PostPosted: Thu May 22, 2008 4:09 pm
Reply with quote

If COPY is used instead of INCLUDE with the DCLGEN variables then syntactically there is no issue with it. The DCLGEN will get expanded during the compilation time if used with COPY like normal copybooks. In case of INCLUDE, it would have expanded during pre-compilation itself. I got to know the following fact from this very forum that during pre-compilation process the pre-compiler performs a basic syntax checking on the embedded SQL queries in the COBOL pgm wherein the columns name of the tables used in the program are matched with the DCLGEN. If we notice a DCLGEN there is a query placed at the top of it which is used for generating the DCLGEN. This query has all the column names listed for the table of whose DCLGEN is being created. The pre-compiler checks the column name of the tables used in the program with the query used for generating the DCLGEN of that table. Infact that is the precise reason why pre-compiler doesn't need DB2 to be up for its operation.

Having said that now if there is a misspeled column name being used in the program, if we are using COPY for DCLGEN this syntax catch will be missed. No doubt, it will get caught during BIND operation. However, if INCLUDE has been used with DCLGEN this bug will be caught in pre-compilation itself.

Corrections are welcome!!!!
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 -> DB2

 


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