LOCK |
Reserve File for Exclusive Use |
LOCK (chan[,ERR=stmtref])
chan |
Channel or logical file number of the file to be locked. |
stmtref |
Program line number or statement label to which to transfer control. |
Use the LOCK directive to reserve a given file for exclusive processing by the user/program. Once a file is locked, no other user or program can gain access to it. However, if another user already has the given file open, the OPEN and LOCK directives fail and PxPlus returns Error #0: Record/file busy.
UNLOCK Remove Exclusive Use from File
0010 open (30,err=0100)"GLFILE"
0020 lock (30,err=0120)
...
0100 print "Cannot open GLFILE"
0110 stop
0120 print "GL still in use—try later"
0130 stop