LIBRM LIBDEF (Define Sublibrary Chain) Macro
This macro causes a chain of up to 32 sublibraries to be built and identified by the name that is given with CHAINID.
Referring to the name of the chain, you can look up a member by searching the chain sequentially (for example, for LIBRM STATE or LIBRM OPEN).
The chain is valid for the duration of a task. Only the task that established the chain can access it. Other tasks from the same or another partition cannot access the chain. However, those tasks can establish a chain with the same name.
See also Library Macro Notation for details on register notation and possible operand specifications.
Format
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.
- CHAINID=chainid
- Specifies the address of an area where the sublibrary chain identifier (1 to 8 alphanumeric characters) is stored.
- CHAIN=chain
- Specifies the address of an array of 1 to 32 entries with
- DS CL7
- containing the library name
- DS CL8
- containing the sublibrary name
The last entry must be followed by 4 characters 'FFFFFFFF'X (decimal value: -1). They do not require a fullword boundary.
- 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=label
- 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 Chain established.
8 Chain not established, since more than 32
sublibraries were specified.
12 Chain not established.
0 Chain contains non-existing sublibrary.
4 Chain contains non-existing library.
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.
Note:
- The chain exists, if it is not overwritten (with the same CHAINID) or dropped (with the LIBDROP macro), or until the task is ended.
- A LIBDEF with CHAINID=ACCESS|SEARCH|CATALOG corresponds to the sublibrary specifications on a Librarian ACCESS and CONNECT (SEARCH and CATALOG) command. They overwrite each other if used within the same task.