COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

2. After setting the CLEARONPURGE flag, call the PURGE routine (directly or through FUP).
The CLEARONPURGE flag has no effect on the outcome of a PURGEDATA operation performed
through FUP or through the CONTROL routine.
Locking
An HP COBOL program can lock and unlock an entire file with the LOCKFILE and UNLOCKFILE
statements. Batch programs lock entire files more often than transaction processing programs do.
An HP COBOL program can lock individual records in a file with the LOCK phrase of the READ
statement and unlock them with either the UNLOCKRECORD statement or the REWRITE statement
with UNLOCK.
You must lock files when one process needs exclusive access to a record, a set of records, or an
entire file for some logical operation to complete successfully (as in the case of TMF). For more
information, see Avoiding Deadlock).
Ownership and Security
Each disk file on the HP system has an owner and a file security. Initially, the owner is the user
who creates the file and the security is the default file security. The owner can transfer ownership
to another user with the FUP GIVE command. The owner of a file can change the file’s security
with the FUP SECURE command.
The security system recognizes a file owner by the user ID, which consists of a group number and
a user number. The operating environment obtains the group number and user number from the
group name and user name when the user logs on; for example, if you log on as PROJECT3.SANDY,
your group name is PROJECT3 and your user name is SANDY, and the operating environment
translates these names to their corresponding group number and user number.
Security Attributes
Security attributes of a disk file allow the owner to control access to the file. If you own a file, you
can change its security at any time with the FUP SECURE command:
FUP SECURE file-name,"RWEP"
MeaningSecurity Attribute
ReadingR
WritingW
ExecutingE
PurgingP
The value of each security attribute determines the class of user who has permission to perform the
corresponding operation on the file (see Table 120).
Table 120 Security Attributes for Disk Files
1
From Anywhere on Expand Network
2
On Local System OnlyWho Can Perform the Corresponding
Operation on the File
UOOwner only
CGAny member of owner’s user group
NAAny user
Not applicable-Local super ID only
1
Uppercase letters are shown, but the corresponding lowercase letters are equivalent.
2
If your HP system is part of an Expand network.
Common Disk File Topics 857