View previous topic :: View next topic
|
Author |
Message |
rameshvaamshy Currently Banned New User
Joined: 19 Aug 2007 Posts: 14 Location: bangalore
|
|
|
|
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 |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
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 |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
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 |
|
|
ermanisharora
New User
Joined: 10 Apr 2007 Posts: 7 Location: Good-gaon
|
|
|
|
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 |
|
|
|