bdfd1m1i | Database Administration |
The following scenario addresses file integrity.
An application has destroyed an UP organized file because the program did not specify key parameters correctly when LRECs were added to the file.
With UP or DOWN organized files, always define the update keys as default keys in the DBDEF macro. The DBDEF statement overrules any key specifications in the DBADD macro or dfadd function. This maintains file integrity and eliminates the risk of application programs using incorrect key parameters when adding LRECs to a subfile.
The default keys are also used by the various ZUDFM commands. This prevents accidental corruption of the file organization. See TPFDF Utilities for more information about the ZUDFM command.
The TPFDF product checks that the primary key of the LREC to be added to the file is defined in the DBDEF. A mismatch results in a system error.
Not applicable.
DBDEF FILE=zzzzzz, - (PKY=#zzzzK80, - KEY1=(PKY=#zzzzK80,UP), - KEY2=(R=zzzzFLD,UP)) or DBDEF FILE=zzzzzz, - (PKY=#zzzzK80, - ORG=UP, - KEY1=(PKY=#zzzzK80), - KEY2=(R=zzzzFLD))
DBADD REF=zzzzzz,NEWLREC=location TPFDF uses the keys defined in the DBDEF.
DBRED REF=zzzzzz,KEY1=(PKY=#zzzzk80) TPFDF uses the keys specified in the application program