Retrieve Library List

RtvLibl

The RtvLibl procedure returns the job's library list value

The RvLibl procedure can be used to retrieve a portion of the job's library list. The library list is returned to a single, character variable. 

nLibCount  RtvLibl(
  szLibL       2750A    Options(*VARSIZE)
  nLibLType      10I 0  Const Options(*NOPASS)

See also: GetLibl

Parameters

szLibl
[input/output Char(2750) ]  A field name that will receive the library list. Each library name is separated by one or more blanks. Although at least one blank is guaranteed to be in inserted between each library name, the actual number of blanks may vary. This parameter may be a field or subfield name, but may not be a data structure name.
 
nLiblType [optional] default=llUserLibl
[input int(4) const]  An option identifier that controls which library list is returned. If unspecified, the user-portion of the jobs library list is returned. The valid options for this parameter are as follows:
 
Constant Literal Value Description
LLUSRLIBL 0 The user-portion of the job's library list is returned (this is the default).
LLCURLIB 1 The current library is returned.
LLSYSLLBL 2 The system-portion of the job's library list is returned.
LLPRODLIBL 3 The production library or libraries are returned.

Return Value

The number of library names returned on the szLibl parameter.

If the function fails or there are no library name in the list for that type of library, the return value is 0.

Remarks

To receive the library list into an array, use the GETLIBL procedure.

Example

 

The following example retrieves the user-portion of the job's library list and store it in the field named szLIBL. The number of library names stored in the szLIBL field is returned and assigned to the field named nCOUNT.

 

 
      /INCLUDE QCPYSRC,LIBL
 
.....DName+++++++++++EUDSFrom+++To+++++TDc.Functions+++++++++
     D szLibl          S           2750A   
     D nCount          S             10A 0
 
     C                   Eval      nCount = RtvLibl(szLibL)