Additional Information about List APIs and a User Space
Before you can use a list API to create a list, the *USRSPC object must exist.
If the user space is too small to contain the list and you have *CHANGE authority
to the user space, the list API extends the user space to the nearest page
boundary. If the user space is too small and you do not have *CHANGE authority,
an authority error results. An extended user space is not truncated when you run
the API again.
When you are creating a list into a user space and the user space cannot hold all
of the available information (the list is greater than 16MB in length), the API places
as much information as possible in the user space and sends a message (typically
CPF3CAA) to the user of the API. The returned list contains only the number of
entries that can fit inside the user space (not the total number of entries available).
Listing Database File Members with a CL Program—Example
To generate a list of members that start with M and are in file QCLSRC in library
QGPL, specify the following:
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ \/
/\ PROGRAM: LSTMBR2 \/
/\ \/
/\ LANGUAGE: CL \/
/\ \/
/\ DESCRIPTION: THIS PROGRAM WILL GENERATE A LIST OF MEMBERS, \/
/\ THAT START WITH M, AND PLACE THE LIST INTO A \/
/\ USER SPACE NAMED EXAMPLE IN LIBRARY QGPL. \/
/\ \/
/\ APIs USED: QUSCRTUS, QUSLMBR \/
/\ \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
PGM
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ CREATE A \USRSPC OBJECT TO PUT THE LIST INFORMATION INTO. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
CALL QUSCRTUS +
('EXAMPLE QGPL ' /\ USER SPACE NAME AND LIB \/ +
'EXAMPLE ' /\ EXTENDED ATTRIBUTE \/ +
X'ððððð12C' /\ SIZE OF USER SPACE \/ +
' ' /\ INITIALIZATION VALUE \/ +
'\CHANGE ' /\ AUTHORITY \/ +
'USER SPACE FOR QUSLMBR EXAMPLE ')
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ LIST THE MEMBERS BEGINNING WITH "M" OF A FILE CALLED \/
/\ QCLSRC FROM LIBRARY QGPL USING THE OUTPUT FORMAT MBRLð2ðð. \/
/\ OVERRIDE PROCESSING SHOULD OCCUR. \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
CALL QUSLMBR +
('EXAMPLE QGPL ' /\ USER SPACE NAME AND LIB \/ +
'MBRLð2ðð' /\ FORMAT NAME \/ +
'QCLSRC QGPL ' /\ DATABASE FILE AND LIBRARY \/ +
'M\ ' /\ MEMBER NAME \/ +
'1') /\ OVERRIDE PROCESSING \/
ENDPGM
2-22 System API Programming V4R1