Rational Developer for System z

Generating declarations from DB2 tables

Rational® Developer for System z® allows you to generate copybooks, include files, macros, and C/C++ header files from database table information using the DB2® utility DCLGEN. This utility makes it easier for you to include database table structures in your programs.
To use the DCLGEN utility, you must first do the following tasks:
  1. Connect to a remote system
  2. Connect to a database

Working with your database table will be easier if you also add the Data Source Explorer to your z/OS® Projects perspective. The Data Source Explorer is a view that shows database tables and the one from which the DCLGEN wizard opens. To open the Data Source Explorer, on the menu bar, click Window > Show View > Data Source Explorer.

To generate a copybook, include file, macro, or C/C++ header file using the DCLGEN utility:
  1. From the Data Source Explorer select a z/OS database table.
  2. From the pop-up menu click DCLGEN. The Generate Declarations wizard opens. Some of the fields in this wizard are completed with default values. These default values are replaced with the values you enter during the current session and are saved for your next session.
  3. Complete the required fields and any other optional fields in the wizard The following table describes the fields on each page.
    Table 1. Generate Declarations (DCLGEN) fields
    Page Field Description
    System information System name The name of the z/OS system on which the DB2 table is located. To select a different system and database table after the wizard starts, select a system name from the drop-down list. Click Connect to connect to the system.
      DB2 subsystem The name of the DB2 subsystem you are connected to.
      Procedure Specify the name of the JCL procedure to be executed. The default is ELAXFDCL. For more information about available sample JCL procedures, see Procedures shipped with Rational Developer for System z.
      Step The JCL step to be executed. The default value is DCLGEN.
      JCL Job Card The default JCL job card in use at your site. You can edit this JCL or add any JCL statements required by your site.
    Generated output Language Choose the language for the generated declaration. This list shows the languages supported by the DCLGEN utility.
    • IBMCOB - IBM® Enterprise COBOL for z/OS
    • PLI - IBM Enterprise PL/I for z/OS
    • C - IBM C/370™
    • COBOL - IBM OS/VS COBOL
    • COB2 - Other COBOL languages
    See the DB2 command reference in the related topics for more information about DCLGEN language options.
      Output data set Specify the name of the data set where the generated JCL is to be stored. Click Browse to select a data set name.
      Member Specify the name of the partitioned data set member to contain the generated JCL.
      Password (if required) If your output data set requires a password, specify it here. This password will be included in the generated JCL.
    DCLGEN Options Connection Displays the DB2 subsystem you are connected to.
      Schema and table Displays the DB2 schema and table you selected.
      Data structure name Specify a name for the generated data structure. The name can contain up to 31 characters.
      Prefix Specify a prefix to be used to form field names in the data structure. The prefix can contain up to 28 characters and will be concatenated with a 1-to-3-digit number to form field names. If you specify a prefix of ABC, for example, field names ABC1, ABC2, and so on up to ABC999 are formed. See the COLSUFFIX option for more options for field names.
      DCLGEN options Select DCLGEN options for the generated data structure. The options available are described briefly below. Refer to the DB2 command reference for the version of DB2 in use at your site for a complete description of these options.
      ACTION Specifies how the partitioned data set member containing the generated data structure is to be created. Select REPLACE to replace an existing partitioned data set member with the member currently being generated or ADD to add the member name as a new member if it does not already exist.
      String delimiter Specifies the host language string delimiter. This option is used for COBOL programs only. Select APOST to specify an apostrophe as the host language string delimiter or QUOTE to specify a quotation mark as the host language string delimiter.
      LABEL Indicates whether to include column labels in the output as comments. Select YES to include the column labels or NO to omit them.
      DBCSSYMBOL Specifies the symbol used to denote a graphic data type in a COBOL PICTURE clause. Select G or N.
      DBCSDELIM Specifies whether the DBCS table and column names in the generated DECLARE table statement are delimited. Select YES or NO.
      COLSUFFIX Determines whether to form field names by attaching the column name to the prefix specified in the Prefix field. Select YES to form field names by appending column names to the Prefix. If the prefix is ABC, for example, and a column name is EMPNO, the generated field name is ABCEMPNO. If no prefix is specified, DCLGEN issues a warning message and uses the column names as the field names. Select NO to use only the Prefix to generate field names.
      INDVAR Determines whether to create an indicator variable array for the host variable structure. Select YES or NO. If you select YES, the array name is the table name with a prefix of “I” (or DBCS letter “<I>” if the table name is double-byte).
  4. Click Finish to generate and submit JCL to create the generated declarations. Rational Developer for System z generates the JCL and submits it to the remote system. If the job completes successfully, the generated data structure is saved in the output partitioned data set member specified on the Generated output page of the wizard.
  5. To see the job output, expand the JES > My Jobs filter in the Remote Systems view and double-click the job name to open the job output.
  6. To see the generated data structure, expand the MVS Files > My Data Sets filter to locate the partitioned data set and member name specified on the Generated output page of the wizard and double-click the member name to open it.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)