Before you can add referential constraints, you must
make sure that you meet some conditions.
- There must be a parent file with a key capable of being a parent key.
If the parent file has no primary key or unique constraint, the system tries
to add a primary key constraint to the parent file if the field attributes
of the potential parent key match those of the foreign key field attributes
of the dependent file.
- There must be a dependent file with certain attributes that match the
attributes of the parent file:
- Sort sequence (SRTSEQ) must match for data types CHAR, OPEN, EITHER, and
HEX.
- The coded character set identifier (CCSID) must match for each SRTSEQ
table unless either (or both) of the CCSIDs is 65535.
- Each sort sequence table must match exactly.
- The dependent file must contain a foreign key that matches the following
attributes of the parent key:
- Data type
- Length
- Precision (packed, zoned, or binary)
- CCSID (unless either has a CCSID of 65535)
- REFSHIFT (if data type is OPEN, EITHER, or ONLY)