If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
How DCLGEN can be used to create Host variables in COBOL-DB2 program
Hi all,
A very good morning to the members. I am very new to DB2 and wanted to know how DCLGEN is used in COBOL-DB2 program.
If anyone can explain with a reference program, kindly help.
The DCLGEN will produce the working storage variables for a table or a view that you can copy into your program. In COBOL, the host variables need to included in the Working Storage Section.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
DCLGEN is a DB2-Command that can be executed in foreground ( e.g. invoked by the TSO/DB2-Interactive Panel ) or in background.
It generates a copy-book that containes the declaration of the table
( EXEC SQL DECLARE TABLE .... ) and that includes also the definitions of
the host variables.
Those definitiones can be generated for the COBOL, PL/I or C -language.
It generates a copy-book that containes the declaration of the table
( EXEC SQL DECLARE TABLE .... ) and that includes also the definitions of
the host variables.
Those definitiones can be generated for the COBOL, PL/I or C -language.
The Decalre Table is actually optional, and is only used by the DB2 precompiler to validate SQL statements that would otherwise not be validated until the bind step. But there is no reason to not use it.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390