LIBRM LOCK (Lock Library Member) Macro

The LOCK (MEMBER) function is used to lock a library member for any write or update access.

The member must be fully qualified. The member can be unlocked again with the LIBRM UNLOCK macro.

See also Library Macro Notation for details on register notation and possible operand specifications.

Format

Read syntax diagramSkip visual syntax diagramlabelLIBRM LOCK,LDCB= areaname,LOCKID= lockid,LIB= lib,SUBLIB= sublib,MEMBER= membername,TYPE= membertype,NOTFND= label,EROPT=RET,EROPT=CANCEL,ERRAD= label

Requirements for the caller

AMODE:
24 or 31
RMODE:
ANY
ASC Mode:
Primary

Parameters

LDCB=areaname
Specifies the address of the LDCB (Librarian Data Control Block) for the request.
LOCKID=lockid
Specifies a lock word by which the lock operation is uniquely identified. The lockid is a string of up to eight alphanumeric characters; it cannot be generic. The specified lockid must be used when the library member is to be unlocked again (with the corresponding UNLOCK function).

The lockid in the LDCB is cleared after processing.

LIB=lib
Specifies the address of an area where the library name (1 to 7 alphanumeric characters) is stored.
SUBLIB=sublib
Specifies the address of an area where the sublibrary name (1 to 8 alphanumeric characters) is stored.
MEMBER=membername
Specifies the address of an area where the member name (1 to 8 alphanumeric characters) is stored. No generic specification is allowed.
TYPE=membertype
Specifies the address of an area where the member type (1 to 8 alphanumeric characters) is stored.
NOTFND=label
Specifies a label to which the service branches, if the specified member does not exist (return code 8 for members that are opened for INPUT), or if the specified library or sublibrary does not exist or is not accessible (return code 12).
EROPT=RET | CANCEL
Defines an error handling option, which is taken, if the function cannot be performed (return code > 12).
RET
Processing is continued, either by a normal return or by branching to the ERRAD exit.
CANCEL
Processing is canceled. A librarian error message is issued to SYSLOG.
ERRAD
Specifies a label to which the Librarian branches, if the above function cannot be performed because of an error (return code > 12).

Return Codes

Return  Reason   Meaning
 Code    Code
  0       0      Member has been locked.
  0       8      The macro is ignored, no member will be locked.
                 Option IGNLOCK is on.
  4       0      The specified member was already locked.
  8       0      The specified member does not exist.
          4      The specified member is locked with a different lockid.
 12       0      The specified sublibrary does not exist.
          4      The specified library does not exist.
 16      xx      External system error with feedback code and message.
 20      xx      Internal system error with feedback code and message.
 32       0      Access control failed (with message L163I).

The external system error feedback codes are described in Librarian Feedback Codes. All other (internal) feedback codes are described in http://publibfp.dhe.ibm.com/epubs/pdf/ieslde10.pdf.