The Declaration Generator Window

The following fields and controls in the Declaration Generator window are used to create declaration files in COBOL, C or PL/I.

Generate Generates a declaration file according to the specifications that have been defined in the Declaration Generator window.
Save As Saves the current specifications to a .DGE file. A .DGE file can be used as input to the Declaration Generator when it is run in batch mode. See Running in Batch Mode for more information about .DGE files and batch mode.

If you specify the name of an existing .DGE file, you will be asked whether the current specification should replace the existing file or be appended to it.

Options Allows you to set options that are specific to the language you have selected.
Exit Closes the Declaration Generator window.
  Location Specifies the location of the table.
  AuthID Specifies the access authority under which you will access the table. In order to create a declaration file, you must have SELECT privileges on the table for which you are generating a declaration, and on the following system tables:
  • SysIBM.SYSLOCATIONS
  • SysIBM.SYSTABLES
  • SysXDB.SYSACFUsers
  Table Name Identifies the table for which the declaration file will be generated.
Declaration The fields in this group box determine how the declaration file is written.
  Output File Specifies the file to which the declaration statements will be written. If you do not specify a path, the file is written to the application path (specified in the PATHS tab in Options) when you select C, or the value of the COBCPY environment variable when you select COBOL or PL/I.

A default file name is automatically created based on the name of the table you select and the language you specify. You can change this name by typing a new one in this field.

If you specify a file that already exists, you will be prompted at run time to choose whether you want to replace the existing file or append the statements to it.

  Structure Name Specifies the name of the record definition (COBOL), structure (C) or declaration structure (PL/I) written to the declaration file. A default name is automatically created based on the name of the table you select and the language you specify. You can change this name by typing a new one in this field.
Language The LANGUAGE group box is used to select the programming language in which you want the declaration written. You can select COBOL, C or PL/I.
  Text Assign a prefix to each field name as it is written into the declaration file. The following shows how field names would be treated if a prefix of emp_ were used.

Remember to take into account your compiler's variable-naming guidelines when assigning a prefix. Do not assign one containing characters that are disallowed by the programming language or that make the variable's name too long.

Generate Generates a declaration file according to the specifications that have been defined in the Declaration Generator window.
Save As Saves the current specifications to a .DGE file. A .DGE file can be used as input to the Declaration Generator when it is run in batch mode. See Running in Batch Mode for more information about .DGE files and batch mode.

If you specify the name of an existing .DGE file, you will be asked whether the current specification should replace the existing file or be appended to it.

Options Allows you to set options that are specific to the language you have selected.
Exit Closes the Declaration Generator window.
  Location Specifies the location of the table.
  AuthID Specifies the access authority under which you will access the table. In order to create a declaration file, you must have SELECT privileges on the table for which you are generating a declaration, and on the following system tables:
  • SysIBM.SYSLOCATIONS
  • SysIBM.SYSTABLES
  • SysXDB.SYSACFUsers
  Table Name Identifies the table for which the declaration file will be generated.
Declaration The fields in this group box determine how the declaration file is written.
  Output File Specifies the file to which the declaration statements will be written. If you do not specify a path, the file is written to the application path (specified in the PATHS tab in Options) when you select C, or the value of the COBCPY environment variable when you select COBOL or PL/I.

A default file name is automatically created based on the name of the table you select and the language you specify. You can change this name by typing a new one in this field.

If you specify a file that already exists, you will be prompted at run time to choose whether you want to replace the existing file or append the statements to it.

  Structure Name Specifies the name of the record definition (COBOL), structure (C) or declaration structure (PL/I) written to the declaration file. A default name is automatically created based on the name of the table you select and the language you specify. You can change this name by typing a new one in this field.
Language The LANGUAGE group box is used to select the programming language in which you want the declaration written. You can select COBOL, C or PL/I.
  Text Assign a prefix to each field name as it is written into the declaration file. The following shows how field names would be treated if a prefix of emp_ were used.

Remember to take into account your compiler's variable-naming guidelines when assigning a prefix. Do not assign one containing characters that are disallowed by the programming language or that make the variable's name too long.

  Numbered Replaces a field name with a number in the declaration file. This option can be selected only when a field prefix is assigned in the TEXT field. The following example shows how field names would be treated if the NUMBERED option were set with a prefix of emp_.
If the Field name is... It will be written as...
ssn emp_ssn
lname emp_lname
fname emp_fname
If the Field name is... It will be written as...
ssn emp_001
lname emp_002
fname emp_003
  Numbered Replaces a field name with a number in the declaration file. This option can be selected only when a field prefix is assigned in the TEXT field. The following example shows how field names would be treated if the NUMBERED option were set with a prefix of emp_.
Computation Specifies the internal storage format assigned to binary integers in a COBOL record description. The choices are COMP, COMP-4 and COMP-5.
Computation Specifies the internal storage format assigned to binary integers in a COBOL record description. The choices are COMP, COMP-4 and COMP-5.