PROTECT (PROT, P)
The PROTECT command controls key field protection for the currently displayed record. Use the PROTECT command to protect or unprotect the currently displayed record, according to whether ON or OFF is specified. If neither option is specified, the currently displayed record is protected. Use the command only when editing a VSAM KSDS data set with DISP=OLD.
The command is available in the Edit function in Formatted mode.
ON
Prohibits edit of the key field for the currently displayed segment or record.
OFF
Allows edit of the key field for the currently displayed segment or record.
Guidelines
Use the PROFILE command to display the current PROTECT value.
The protection status of each record is the same whether you are or are not using record layouts (Character and Formatted modes.) Changing the protection status of a record in either mode affects the protection of its key field in both modes.
When you are editing the entire file and are not using selection criteria, use the P (Protect) and U (Unprotect) line commands to protect and unprotect the key field. When you are editing selected records, the U (Unprotect) line command is invalid.
When a protected record is displayed, the key field name is highlighted on the display and the data contained in the key field cannot be modified. When an unprotected record is displayed, the key field is not protected and can be edited.
When applying selection criteria or editing a shared (DISP=SHR) or non-reusable VSAM data set, File-AID does not allow you to unprotect selected keys. To modify the key in these circumstances, duplicate (repeat) the record, change the key of the duplicate and delete the original.
If the PROTECT ON is invoked when a nonkeyed data set is being edited, the error message: NOT A KEYED DATASET is displayed and the command is ignored.