Previous Topic Next topic Print topic


To generate a copybook for a table

  1. From the main menu, click Tools > SQL Option for DB2 > Client > Declaration Generator.
  2. On the XDB Declaration Generator window, specify the table you require in the Table group.
  3. In the Declaration group, type a location and name for the copybook in the Output File field.
  4. Optionally, in the Structure Name field, type a name for the group data item to be created.
  5. Optionally, click Options to specify a level for the group data item to be created.
  6. In the Field Prefix group, type a prefix to be added to the column names in the table to create host variables. For example, you might use EMP as the column name prefix for a table called EMPLOYEES.
  7. Select Text if you want the column name to be appended to the specified prefix to create the host variable name.

    Alternatively, select Numbered if you want the column's numeric position in the table to be appended to the specified prefix to create the host variable name.

  8. In the Computation group, click the data format you require for the host variables.
  9. Click Generate.

A copybook containing host variables for accessing the specified table is created.

Tip:

Click Save As to save the settings you made on the Declaration Generator window. You can use the .DGE file that is produced to run the Declaration Generator in batch mode. For more information, see Running in Batch Mode in the Declaration Generator help.

Previous Topic Next topic Print topic