Member List (MBRLIST) UDTF

Index

Schema IQUERY

MBRLIST( library_name => '*LIBL', 
         file_name => 'file-name', 
         mbr => 'member0name'
         mbr_text=> 'member-text' )

The Member List (MBRLIST) User Defined Table Function returns one row for each member name that matches the input criteria. It is intended as an alternative interface to the DSPFD TYPE(*MBRLIST) CL command. To that end, the resulting column names match those from DSPFD OUTPUT(*OUTFILE) TYPE(*MBRLIST) for the most part. Not all values returned by DSPFD are returned and the Member Creation and Last Date/Time Changed values are returned as actual timestamp data-types. The MBRLIST UDTF uses the System Partition interface to produce the list of member names; it does not actually use DSPFD. The MBRLIST UDTF is an alternative to using DSPFD, so instead of dumping the output from DSPFD into an output file and then reading it using SQL in your RPG IV application, you can simply evoke the MBRLIST UDTF and directly get the results you need--no output file necessary.

Parameters

LIBRARY_NAME

Default: *LIBL

Special Values: *ALL, *LIBL, *CURLIB, *CURRENT

The library name of the file whose members are to be returned. The Library Name may be generic (using either the asterisk or the percent symbol) as in 'OE*' or 'INV%'. If unspecified, *LIBL is used. The special values *ALL, *ALLUSR, *LIBL, and *CURLIB (or *CURRENT) may be specified to control which set of libraries are searched. 

FILE_NAME

Special Values: *ALL, *

The name of the file whose members are to be listed. This is a required parameter. This name may be generic, full or unspecified to indicate all files with members that match the member criteria are returned. Note it can take a long time to return all member names in all files, so choose wisely. If this parameter is not specified or is set to '*' the File name is not used to filter the member list.

MBR

Default: *

Special Values: *ALL, *

The name of the member(s) that are returned. This is usually either unspecified, a full name, or a partial name using the generic name notation (iQuery supports % and * as generic symbols on input parameters. If this parameter is not specified or is set to '*' or '*ALL' then the member name is not used to filter the member list.

MBR_TEXT

Default: *

The text to be used to filter the returned member list. Only member names that match the MBR_TEXT value are returned. Generic support is enabled via the SQL LIKE predicate. Any pattern supported by LIKE is allowed. If this parameter is not specified, or is set to a single asterisk, then the Member's text description is not used to filter the member list.

SRCONLY

Default: *NO

Use this parameter to restrict the search and results to Source Files Only. *YES, or 1 means Source Files Only, '0' or *NO means all files. Typically this parameter is unnecessary because users tend to specify the file name, such as "QRPGLESRC" when doing the member list. However, if a Member name search is being performed or yours shop uses unconventional source file names, then specifying SRCONLY =>'1' may be useful to optimize the search. The special values for *YES are, '1', '*TRUE', '*SI', '*ONLY', '*DA' the leading asterisk is optional. Any other value implies *NO.

Examples

select mlLib,mlFile,mlname,mlseu,mlmtxt 
FROM TABLE( iQuery.MBRLIST( file_name=>>'QRPGLESRC', mbr=>'ORD*')) ml;
select * from table(iQuery.mbrlist(file_name=>'*all', library_name=>'DEVLIB', mbr=>'ORD%', srconly=>'true')) mbrlist;

The first example returns a list of members whose name begins with 'ORD' for the QRPGLESRC source file. All QRPGLESRC files on the library list are searched and returned.

The second example searches for all source member whose name begins with 'ORD'. The file name is specified as *ALL but a single asterisk is also valid to indicate all file names, so all files on the library list are searched. However, the SRCONLY (source file only) parameter is set to TRUE, so only source files are actually searched; standard database files are not included in the search for matching member names.

ResultSet Columns

Column Data Type Description
MLRCEN
CHAR(1)
The "century digit" for the date returned in the MLRDAT column. Add 19 to this value to get the century portion of the date.
MLRDAT
CHAR(6) The date the resultSet was generated.
MLRTIM
CHAR(6) The time the resultSet was generated.
MLFILE
CHAR(10) The name of the file that contains the member named returned in the MLNAME column.
MLLIB CHAR(10) The name of the library where the file name in MLFILE is located.
MLFTYP
CHAR(10)
The object type. Since only files are returned, this column always contains *FILE
MLFATR
CHAR(10) The The file attribute, such as PF (normally this is always PF)
MLSYSN
CHAR(8)
The system name where the object was created.
MLASP
DEC(3,0)
The ASP for the object.
MLNOMB
DEC(5,0) The number of members in the file identified in the MLFILE column.
MLNAME
CHAR(10) The name of the member.
MLNRCD
CHAR(10) The number of records in the member.
MLNDLR
DEC(10,0) The number of deleted row/record in the member.
MLSIZE
DEC(15,0)
The member's dataspace size in bytes.
MLRCDL
DEC(5,0)
The record length for the file.
MLSEU
CHAR(10)
The SEU Type for the member, if this is a source file otherwise it is blank. Note that this is the MLSEU2 value from DSPFD but is named MLSEU since we only return one value.
MLCCEN
CHAR(1)
The "century digit" for the date the member was added to the file "Member creation date".
MLCDAT
CHAR(6)
The date the member was added to the file. The member's "creation date".
MLCTIM
CHAR(6)
The time the member was added to the file.
MLCHGC
CHAR(1)
The "century digit" when the source member content was last changed.
MLCHGD
CHAR(6)
The date the source member content was last changed.
MLCHGT
CHAR(6)
The time the source member content was last changed.
MLMTXT
CHAR(50)
The member text description
MLUCEN
CHAR(1)
The "century digit" for the date the File was last used.
MLUDAT
CHAR(6)
The date the File was last used.
MLUTIM
CHAR(6)
The time the File was last used..
MLUCNT
DEC(5,0)
Days since last Used Count was reset.
MLUCEN
CHAR(1)
The "century digit" for the date the last used was reset.
MLUDAT
CHAR(6)
The date the last used was reset.
MLLFILE
VARCHAR(128)
The long SQL file name
MLLLIB
VARCHAR(128)
The long SQL Schema (Library) name
MLLMBR
VARCHAR(128)
The long SQL member name
CREATEDTS
TIMESTAMP
The date/time the member was created (added to the file) as a Timestamp value.
LASTCHGDTS
TIMESTAMP
The date/time the member's content (if it is a source file member) was last changed, as a Timestamp value.
LASTUSEDDATE
DATE
The date the object was last used.