Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

INCLUDE statement and a DCLGEN member name in COPY statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: INCLUDE statement and a DCLGEN member name in COPY statement
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us