Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.mbrList() UDTF returns one row for for each member in the specified database file table name. The resultSet is purposely formatted to be similar to the DSPFD *MBRLIST OUTPUT(*OUTFILE) CL command results--but is more flexible and much faster.
UDF | Return Type | Description |
mbrList | TABLE | Returns a resultSet that contains the list of member names and properties from the specified database table. |
table( iQuery.mbrList( 'library', 'physical file', 'member name', 'text description' )) ml
The library name is the name of the library that contains the physical file named on the 2nd parameter.
The physical file is the name of the table whose member list is to be generated.
The optional member name identifies the members to be listed. Specify a generic name. If unspecified *ALL is the default. Use a generic member name, such as 'OE05*' or 'PO100%'.
The optional text description parameter may be specified to reduce the resultSet based on the text description. Use a generic text such as 'SALES%' or 'SALES*', or even '*ORD*'.
Please note, the resultSet is purposely based on the output from the DSPFD *MBRLIST CL command. So the sequence of columns and column names are based on that CL command's results. However iQuery.mbrlist() does not use DSPFD to generate its resultSet.
Column | Type | Description |
MLRCEN | char(1) | The century digit (as text) of when the member list is produced. |
MLRDAT | char(6) | The date when the member list is produced. |
MLRTIM | char(6) | The time when the member list is produced. |
MLFILE | char(10) | The file name of the file whose member list is produced. |
MLLIB | char(10) | The library name of the file returned in the MLFILE column. |
MLFATR | char(10) | The file attribute of the file returned in the MLFILE column. |
MLSYSN | char(8) | The system name where the file exists. |
MLASP | dec(3,0) | The ASP that contains the file. |
MLNOMB | dec(5,0) | The number of members in the file specified in the MLFILE column. |
MLNAME | char(10) | The member name. |
MLNRCD | dec(10,0) | The number of records in the member. |
MLNDTR | dec(10,0) | The number of deleted records in the member. |
MLSIZE | dec(15,0) | The data space size, in bytes. |
MLRCDL | dec(5,0) | The record length. |
MLSEU | char(10) | The legacy SEU attribute column. See MLSEU2 for current value. |
MLCCEN | char(1) | The member creation century digit as text. |
MLCDAT | char(6) | The member creation date |
MLCTIM | char(6) | The member creation time |
MLCHGC | char(1) | The member last changed century digit as text. |
MLCHGD | char(6) | The member last changed date |
MLCHGT | char(6) | The member last changed time |
MLMTXT | char(50) | Member text description |
MLUCEN | char(1) | The member last used century digit as text. |
MLUDAT | char(6) | The member last used date |
MLUTIM | char(6) | The member last used time |
MLUCNT | dec(5,0) | Days used count |
MLTCEN | char(1) | Century when Last Used Date was Reset |
MLTDAT | char(6) | Date when last Used Date was Reset |
MLLFILE | varchar(128) | Long file/table name |
MLLLIB | varchar(128) | Long library/schema name |
MLLMBR | varchar(128) | Long member name |
CREATEDTS | timeStamp | TimeStamp when the member was added/created in the file. |
LASTCHGDTS | timeStamp | TimeStamp when the member was last changed. |
LASTUSEDDATE | Date | Date when the member was last used. |
select * from table( iQuery.mbrList( 'IQUERY','QIQMACRO', NULL, '*JOB*')) ml;
The output from the above UDTF would list all the members in file QIQMACRO in the IQUERY library that contain the word "JOB" somewhere in their text description.