File Utility Programming (FUP) Reference Manual

FUP Commands
File Utility Program (FUP) Reference Manual523323-015
2-20
ALTER Guidelines
To alter a file, you must have both read and write access to it.
Changing the AUDIT option for DP2 files also changes the default value of the
BUFFERED attribute.
If you specify NO AUDIT, the BUFFERED option and file label default is set to NO
BUFFERED. If you specify AUDIT, the BUFFERED option is set ON. If you have
explicitly set the BUFFERED attribute, that value remains unchanged.
Adding the AUDIT attribute to a file causes audit records to be written for the file.
If you use the AUDIT option and the volume containing the primary file, or any of its
secondary partitions or alternate-key files containing at least one automatically
updated alternate key, is not audited, the request fails. You receive file-system
error 80 (invalid operation on audited file or nonaudited disk volume). If these files
are all audited, the labels of the alternate-key files are updated to reflect the audit
option.
To add an alternate key to a structured file that does not have any alternate-key
files specified, your ALTER command must specify both the new alternate key and
the new alternate-key file. This is also true if you try to delete an alternate key with
the DELALTFILE option of the ALTER command.
For example, to add the alternate key “aa” to the file FRED and specify the
alternate-key file AFILE:
-ALTER FRED, ALTFILE (0, AFILE), ALTKEY ("aa", FILE 0,&
-KEYOFF 0, KEYLEN 5)
Altering the NULL or UPDATE attribute of an alternate key for a file does not
change the actual contents of the alternate-key file. You must update the data
(usually with the FUP LOADALTFILE command) to make the alternate-key file
completely consistent with the primary-key file. If your application does not require
complete consistency, you might not need to reload the alternate-key file.
Altering the UNIQUE attribute of an alternate key for a file makes the file
description inconsistent with its alternate-key files. Subsequent attempts to open
the file cause file-system error 4 (failure to open an alternate-key file). To use the
file after the UNIQUE attribute for an alternate key is altered, purge the alternate-
key file, re-create it, and adjust its key length. Files with the UNIQUE attribute have
a different key length than files with the NO UNIQUE attribute.
When you alter an alternate key from NO UNIQUE to UNIQUE, the contents of the
records in the primary file are not examined. The file could contain records with
duplicate values in the alternate-key field while you are changing its description.
The FUP ALTER command does not recognize the existence of duplicates, but the
duplicates cause an error when the alternate-key file is loaded.
Note. For more information about the storage of alternate keys in alternate-key files, see
the Enscribe Programmer’s Guide.