This document is organized as follows:
Adabas 8.2.2 now allows you to define system fields in your Adabas files.
A system field is a field in an Adabas file whose value is automatically set by the Adabas nucleus when records are inserted or updated on the file. They may not be part of a periodic group but can be simple fields or MU fields (although not MU fields in a periodic group).
Optionally, you can specify that some system field values only be set when records are inserted. System fields are fields that store information such as the job name of the user making the update, the eight-byte user ID of the user, the session ID of the user, or the time at which the update was made (see the information on CR option).
The value of a system field refers to an insert or update of an entire record. You cannot define a system field that refers to only a portion of a record.
Values for system fields are saved in the compressed storage record in the same manner that other Adabas fields are stored.
For detailed information on system fields see System Fields in the Adabas for Mainframes Concepts and Facilities documentation.
To review the Field Definition Table (FDT) for a file:
List the files in a database, as described in Listing Database Files.
If an icon appears in the Fields column of the list of files table in detail-view, click the icon.
The FDT for the file appears in detail-view. The table provides the following information:
Field | Explanation | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Level | the field level | ||||||||||||||||||||||||
Name | the field name | ||||||||||||||||||||||||
Length | the field length | ||||||||||||||||||||||||
Format | the data type of the field: | ||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Option |
|
||||||||||||||||||||||||
Predict Name | equivalent Predict name, if any |
When available, the Special Descriptor Table (SDT) is also displayed. It shows field information about all sub-/super-/hyperdescriptors, collation descriptors, phonetic descriptors, and sub-/superfields for the file.
The table provides the following information:
Column | Explanation | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type |
|
||||||||||||||||||||||
Name | the field name | ||||||||||||||||||||||
Length | the field length | ||||||||||||||||||||||
Option |
|
||||||||||||||||||||||
Parent | the name of the parent field for this descriptor. | ||||||||||||||||||||||
Predict Name | equivalent Predict name, if any |
You can also export a Field Definition Table and import it later during the creation of a new file.
Display the FDT and press
.In the resulting Export Field Definition Table panel, specify the location for the file and click to save your entries or to return to the FDT.
A referential constraint ensures referential integrity between two keys. Keys can be descriptors, superdescriptors or ISNs. Referential integrity means that for every value in a descriptor called “foreign key”, there must be a value in a descriptor called “primary key" in a primary file. The primary key must be defined as unique and the options NC and NN must be set. For the foreign key, the option NC must be set. A pair of primary and foreign key must have the same format. ISNs can be used as primary keys and the corresponding foreign key must be binary. If primary and foreign keys are superdescriptors, then
The corresponding key must be a superdescriptor;
The superdescriptors must have the same number of parent fields;
The corresponding parent fields must have the same format;
No parent field may occur twice in a superdescriptor;
No parent field may occur in more the one foreign key;
All parent fields must have the option NC;
All parent fields of the primary key must have the option NN;
The primary key superdescriptor must be unique.
You can specify a referential action that is executed on the foreign key record if a primary key value is modified.
The referential constraint is added to the file to which the foreign key belongs.
Note:
The setting of referential constraints is a designated long running
utility because all descriptor entries must be checked to ensure that they do
not violate the new constraint.
See also Referential Constraints in FDT Record Structure in the Adabas Administration documentation for open systems.
To add a constraint:
In the Field Definition Table (FDT), press
.In the resulting Referential Constraints panel, enter the required specifications and click to save your entries or to return to the FDT.
Note that Adabas for Open Systems now supports referential integrity constraints - this means that any field in a file which is defined as a foreign key can only contain values from a primary files's primary key. This prevents you from defining records in a file containing a foreign key value that is not contained in the corresponding primary file as a primary key value (for more information see Referential Integrity Constraints and also Referential Constraints in FDT Record Structure in the Adabas Administration documentation for open systems).
To change field parameters:
In the Field Definition Table (FDT), click the name of the field you want to change the parameters for.
The Change Field Parameters panel is displayed.
To modify the standard length of an Adabas field, update the Length value as required.
For mainframe databases you can also select the LA option to change a normal alphanumeric (A) field to a long-alpha (LA) field. If the file is protected, supply the password.
Click
to save your entries or to return to the file list display.With Adabas Manager version 7.7.3 you can logically delete and undelete a field from a database file. Logically deleting a field from a file removes the field from the FDT, but retains the field data in the database. Logically undeleting a field that was previously logically deleted reinstates the field in the FDT.
Note:
Logically undeleting a field is only possible for mainframe
databases.
To delete a field:
In the Field Definition Table (FDT), click the name of the field you want to delete.
The Change Field Parameters panel is displayed.
Click
or to return to the file list display.The field is displayed in the FDT with the option deleted.
Note:
The parent field of a descriptor cannot be deleted; attempting to
delete such a field will result in an error message.
Deleting a field in the Field Definition Table (FDT) only logically deletes the field; the field can be reactivated at any time.
To reactivate a logically deleted field (mainframe databases only):
In the Field Definition Table (FDT), click the name of the deleted field you want to reactivate.
The Change Field Parameters panel is displayed.
Click
or to return to the file list display.The field is displayed in the FDT without the option deleted.
Field names listed in the Field Definition Table (FDT) with an option "DE" are descriptors. You can remove a descriptor by freeing the specified field's inverted list in the Associator.
The functions Release Descriptor, Set Unique Descriptor and Reset Unique Descriptor are designated long running utilities.
To release a descriptor:
In the Field Definition Table (FDT), click the name of the field you want to release the descriptor for.
Or:
If a Special Descriptor Table (SDT) is shown, click the icon in the
Parameters column of the descriptor you want to
release.
The Change Field Parameters panel is displayed.
Click
.In the resulting panel, confirm that you want to release the descriptor by clicking on
, or . Both options will return you to the FDT display.To set a unique descriptor for open systems databases:
In the Field Definition Table (FDT), click the name of the field you want to set the descriptor for.
Or:
If a Special Descriptor Table (SDT) is shown, click the icon in the
Parameters column of the descriptor you want to set to
unique.
The Change Field Parameters panel is displayed.
Click
.In the resulting panel, confirm that you want to set the descriptor by clicking on
, or . Both options will return you to the FDT display.To reset a unique descriptor for open systems databases:
In the Field Definition Table (FDT), click the name of the field you want to reset the descriptor for.
Or:
If a Special Descriptor Table (SDT) is shown, click the icon in the
Parameters column of the descriptor you want to reset.
The Change Field Parameters panel is displayed.
Click
.In the resulting panel, confirm that you want to reset the descriptor by clicking on
, or . Both options will return you to the FDT display.Field names listed in the Field Definition Table (FDT) with an option "DE" are descriptors; this option can be logically removed from a field.
To logically delete a descriptor:
In the Field Definition Table (FDT), click the name of the field you want to remove the descriptor from.
The Change Field Parameters panel is displayed.
Click
to remove the descriptor and return to the FDT.The following Predict parameters must be specified in the FDT to enable the display of the Predict field name of a file.
To set the Predict parameters:
In the Field Definition Table (FDT), click the name of the field you want to set the parameters for.
The Change Field Parameters panel is displayed.
In the upper left corner of the FDT display, click
().The Predict Parameters panel appears.
Enter the following parameters:
FDIC DBID | The ID of the database containing the Predict repository. |
FDIC FNR | The file number of the FDIC file. |
Click
to save your entries or to return to the file list display.To add new fields in the Field Definition Table (FDT):
In the Field Definition Table detail-view, click
.The Add New Fields panel for the file is displayed.
Specify the new fields you want to add to the file.
Click
to add more rows to the table if necessary.Click
to save your modifications or to return to the previous panel.