Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2007
    Posts
    3

    Unanswered: 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.

    Thanks,
    Niraj

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  3. #3
    Join Date
    Sep 2007
    Posts
    3

    DCLGEN query

    Hi Marcus,

    Thanks for your reply.
    Still my question is how it is done.
    I mean, is DCLGEN a utility that creates host variables?

    Waiting for your reply,
    Nitesh

  4. #4
    Join Date
    Sep 2007
    Posts
    3

    DCLGEN query

    Hi Marcus,

    Thanks for your reply.
    Still my question is how it is done.
    I mean, is DCLGEN a utility that creates host variables?

    Waiting for your reply,
    Nitesh

  5. #5
    Join Date
    Dec 2005
    Posts
    273
    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.

  6. #6
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Logon on to TSO and go to the DB2 panel, and select DB2I.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  7. #7
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by umayer
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •