The object type File Relation documents relationships between files. The relationship is established by means of references to fields.

This document covers the following topics:
The following topics are covered below:
The File Relation Maintenance menu is called with function
code M and object code RL in a Predict main menu or the command MAINTAIN
FILE RELATION.
13:05:08 ***** P R E D I C T ***** 2007-05-31
Plan 3 - (RL) File relation Maintenance - Profile HNO
Function Function
A Add a File relation D Display File relation
C Copy File relation L Link children
M Modify File relation S Select File relation from a list
N Rename File relation
P Purge File relation
Function .........
File relation ID . Attributes.........*
Copy ID ..........
for file ID ......
Restrictions .....* Profile HNO,used Association.....*
Command ===>
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Help Next Stop Last LnkEl Flip Print Impl AdmFi SelFi Prof Main
|
Note
Parameters not listed here are described under Global Attributes.
| Parameters | |
|---|---|
| Function | Executes one of the maintenance functions. All standard maintenance functions are described in the section Maintenance in the Predict Reference documentation. |
| for file ID | For the Select function: a file ID can be specified as an additional selection criterion. Asterisk notation is possible. |
The table below contains a list of all valid file relation types.
| Code | File Relation Type |
|---|---|
| C | Two files of type A are physically coupled. |
| D | The file relation is only documented. |
| K | Common keys. This file relation type is only valid for file
types YT and YV (Sybase tables and views). The field linked to the file relation
must have a non-blank descriptor type. Predict checks whether the number,
formats and character sets of the fields - or source fields in the case of
superdescriptors - in file 1 and file 2 agree.
For Sybase, you can generate a common key from a file relation of this type. For other database management systems, file relations of this type are used for documentation purposes only. |
| N | This file relation type documents the models used by Natural Construct. See Defining File Relations for Objects in Predict in the Natural Construct User's documentation. |
| R | Ref. Constraint. Files of type AT, BT, D, JT, OT, X, XT, XV, Y, and YV are connected by referential integrity. |
| S | Files of type A are soft coupled. |
The screen below is displayed for the Add a File Relation function. The Copy and Modify screens are similar.
13:30:23 ***** P R E D I C T ***** 2007-05-31
- Add a File relation -
File relation ... HNO-RL
Type ...........*
Keys .. Zoom: N
Cardinality ..* :
File 1 Minimum ...
File ID ....* HNO-FI1 Average ...
Field ID ...* HNO-EL1 Maximum ...
File 2 Minimum ...
File ID ....* HNO-FI2 Average ...
Field ID ...* HNO-EL1 Maximum ...
Constraint attributes
Update type .....* (none)
Delete type .....* (none)
Constraint name ..
Enforce .......... (Y/N)
Usage ........* (none)
Abstract Zoom: N
Additional attributes ..* N Associations ..* N
|
Note
Parameters not listed here are described under Global Attributes.
| Parameters | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| File Relation | The ID of the file relation object. | ||||||||||||||||
| Type | The type of file relation. For a list of valid values, see File Relation Types. See also table in the section Validity Checks for File Relations. | ||||||||||||||||
| Cardinality |
|
||||||||||||||||
| File 1 (File ID, Field ID) | One of the related files. If the type of file relation is R, the field which is used to link this table must be a unique descriptor or ISN (Adabas), a primary index (for DB2) or a unique key (for other SQL systems). | ||||||||||||||||
| File 2 (File ID, Field ID) | The other related file. If the type of file relation is R, the field which
is used to link this table must be one of the following:
|
||||||||||||||||
| Minimum | The minimum number of occurrences of a field from File 1 or File 2 in the file relation. | ||||||||||||||||
| Average | The average number of occurrences of a field from File 1 or File 2 in the file relation. | ||||||||||||||||
| Maximum | The maximum number of occurrences of a field from File 1 or File 2 in the file relation. | ||||||||||||||||
| Constraint Attributes | |||||||||||||||||
| Update type |
|
||||||||||||||||
| Delete type |
|
||||||||||||||||
| Constraint name | The constraint name for a file relation of type D and R. For files of type A, the constraint name must follow the Adabas short name conventions. For details refer to Field Names in Record and Field Definitions of the section Adabas Design in the Adabas Concepts and Facilities documentation. | ||||||||||||||||
| Enforce | Only applicable to file relations of type D or R. Specifies whether or not the referential constraint is enforced by DB2 during normal operations such as insert, update or delete. Valid values: Y (Enforce) or N.. | ||||||||||||||||
| Construct Usage | |||||||||||||||||
| Usage |
|
||||||||||||||||
The validity checks performed by Predict depend on the file relation type:
| Type | Applicable for | Validity Checks |
|---|---|---|
| Physically Coupled | Adabas | May not be any of the following:
|
| Type | Applicable for | Validity Checks |
|---|---|---|
| Documented | all types | None |
| Type | Applicable for | Validity Checks |
|---|---|---|
| Common Keys | Sybase tables and views | The field linked to the file relation must have a non-blank descriptor type |
| Type | Applicable for | Validity Checks |
|---|---|---|
| Natural Construct | all types | Both the field and file containing the file relation must be defined in Predict. |
| Type | Applicable for | Validity Checks |
|---|---|---|
| Referential Constraint |
Adabas File |
Must be marked in the table of file 1: For file type DB2 table or Informix table/view:
Must be marked in the table of file 2: for file type Adabas file:
|
| Type | Applicable for | Validity Checks |
|---|---|---|
| Soft-coupled | Adabas | May not be any of the following:
|
With Predict retrieval functions, file relations between physical files are treated as though they were connected with the userviews of the files.
Restricts the scope of the function to file relations which apply to the specified file. Asterisk notation can be used to specify a range of files.
13:36:22 ***** P R E D I C T ***** 2007-05-31
- List File relation -
---------------------------------------------------------------------------
Cnt File relation ID Type File 1 File 2
1 AER-TST-SYS1-19 D AER-TST-SYS1 AER-TST-SYS2
2 AER-TST-SYS2-18 D AER-TST-SYS2 AER-TST-SYS1
3 AMMM D
4 ARH-RL D ARHTESTCHEN ARH-BT1
5 ARH-RL-FUER-BT-FILE K ARH-BT1 ARH-BT1
6 ARH-RL-K K ARH-D1 ARH-D1
7 ARH-RL1 D ARH-123456789012 ARH-123456789012
8 ARH-RL2 R ARH-OT1 ARH-OT1
|
| Meaning of Columns | |
|---|---|
| File Relation ID | ID of the file relation object. |
| Type | The type of file relation. See table in the section Validity Checks for File Relations for list of valid types and codes. |
| File 1 | One of the related files. |
| File 2 | The other related file. |
The output options valid for this object type are identical to those for object type Dataspace. See Output Options for Dataspace Retrieval.