Add Data Definition (ADDDTADFN)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Add Data Definition (ADDDTADFN) command copies 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:

Only format and field definitions of database files using the following functions are added to a dictionary:

Note: When adding a file that is already linked, the current link is ended and then the definition is added and linked.

Top

Parameters

Keyword Description Choices Notes
FILE Data base file Qualified object name Required, Positional 1
Qualifier 1: Data base file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DTADCT Data dictionary Name Required, Positional 2
DFN File definition Name, *FILE Optional, Positional 3
Top

Data base file (FILE)

Specifies the name and library of the externally described database file from which the definition is copied to the specified dictionary.

This is a required parameter.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the file. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.
Top

Data dictionary (DTADCT)

Specifies the name of the dictionary to which the definitions are added. This is a required parameter.

Top

File definition (DFN)

Specifies the name the file definition is given when it is copied into the dictionary.

The possible values are:

*FILE
The name of the file definition is the same as the database file name specified in the Data base file prompt (FILE parameter).
file-definition
Specify the name the file definition is given when copied to the data dictionary.
Top

Examples

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.

Top

Error messages

*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.
Top