ADDDTADFN (Add Data Definition)
ADDDTADFN Command syntax diagram
Purpose
The Add Data Definition (ADDDTADFN) command allows the user to copy file, record format, and field definitions from an externally described database file to a data dictionary.
When definitions are added to a dictionary, the system does a search to find out if the dictionary contains a definition with the same name as the one being added. If an exact match of the definition is found, the existing definition is used. If an exact match is not found, a new version of the definition is created.
Database files using the following functions are not added to a dictionary:
- Access path sharing
- Alternate collating sequence
- Program-described file
- Join logical file
- Logical file
- with select/omit specifications
- based on more than one file
Only format and field definitions of database files using the following functions are added to a dictionary:
- Field default values
- Field validity check codes
- Key fields defined using names based on physical files
- Derived fields
Note: When adding a file that is already linked, the current link is ended and then the definition is added and linked.
Required Parameters
- FILE
- Specifies the qualified name of the externally described database file from which the data definition is copied to the specified dictionary. A database file name must be specified.
The name of the file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
database-file-name: Specify the name of the database file from which the definition is copied to the specified dictionary.
- DTADCT
- Specifies the name of the dictionary to which the definitions are added.
Optional Parameters
- DFN
- Specifies the name given to the file definition when it is copied into the dictionary.
*FILE: The name of the file definition is the same as the database file specified in the FILE parameter.
file-definition-name: Specify the name given to the file definition when copied to the data dictionary.
Example for ADDDTADFN
ADDDTADFN FILE(MYLIB/MYFILE) DTADCT(MINE) DFN(*FILE)This command copies the definitions from MYFILE located in library MYLIB to the dictionary MINE. The file definition has the same name as the database file specified in the FILE parameter.
Error messages for ADDDTADFN
*ESCAPE Messages
- CPF2E9E
- Not enough space to add to dictionary &1.
- CPF2FE0
- Error occurred while opening dictionary &1.
- CPF2FE1
- Error occurred while closing dictionary &1.
- CPF2FE2
- Dictionary &1 currently in use.
- CPF2F02
- Not authorized to use dictionary &1.
- CPF2F07
- Dictionary &1 in error.
- CPF2F08
- Dictionary &1 not found.
- CPF2F61
- File &2 in &3 currently in use.
- CPF2F72
- File &2 in &3 not valid for ADDDTADFN.
- CPF2F73
- ADDDTADFN not allowed for SQL database files.
- CPF2F74
- Attributes of file &2 in &3 not supported.
- CPF9812
- File &1 in library &2 not found.
- CPF9820
- Not authorized to use library &1.
- CPF9822
- Not authorized to file &1 in library &2.