Guardian Procedure Calls Reference Manual
UNLOCKFILE Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Condition Code Settings
Considerations
OSS Considerations
Example
Related Programming Manual
Summary
The UNLOCKFILE procedure unlocks a disk file and any records in that file currently locked by the
user. The "user" is defined either as the opener of the file (identified by filenum) if the file is not
audited—or the transaction (identified by the TRANSID) if the file is audited. Unlocking a file allows
other processes to access the file. It has no effect on an audited file that has been modified by the
current transaction.
NOTE: The UNLOCKFILE procedure performs the same operation as the FILE_UNLOCKFILE64_
Procedure (page 518), which is recommended for new code.
Key differences in FILE_UNLOCKFILE64_ are:
• The tag parameter is 64 bits wide.
• The procedure returns an error code value rather than a condition code, simplifying
error-handling code.
Syntax for C Programmers
#include <cextdecs(UNLOCKFILE)>
_cc_status UNLOCKFILE ( short filenum
,[ __int32_t tag ] );
• CEXTDECS (through the included file TNSINTH) defines 32-bit values as the typedef
__int32_t, which for TNS and TNS/R compiles is defined as long and for TNS/E compiles
is defined as int.
• The function value returned by UNLOCKFILE, which indicates the condition code, can be
interpreted by _status_lt(), _status_eq(), or _status_gt() (defined in the file
tal.h).
Syntax for TAL Programmers
CALL UNLOCKFILE ( filenum ! i
,[ tag ] ); ! i
UNLOCKFILE Procedure 1433