Where allowed to run: Compiled CL program or interpreted REXX (*BPGM *IPGM *BREXX *IREXX) Threadsafe: No |
Parameters Examples Error messages |
The Retrieve Member Description (RTVMBRD) command is used in a CL program or REXX procedure to retrieve (return) the member-level information (in CL variables) from a database file.
The values are returned (copied) to the specified CL variables. The following kinds of member information can be retrieved:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | File | Qualified object name | Required, Positional 1 |
Qualifier 1: File | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MBR | Member | Single values: *FIRST, *LAST Other values: Element list |
Optional |
Element 1: Reference member | Generic name, name, *FIRSTMBR, *LASTMBR | ||
Element 2: Relationship | *SAME, *NEXT, *PRV | ||
RTNSYSTEM | CL var for RTNSYSTEM (4) | Character value | Optional |
RTNLIB | CL var for RTNLIB (10) | Character value | Optional |
RTNMBR | CL var for RTNMBR (10) | Character value | Optional |
FILEATR | CL var for FILEATR (3) | Character value | Optional |
FILETYPE | CL var for FILETYPE (5) | Character value | Optional |
SRCTYPE | CL var for SRCTYPE (10) | Character value | Optional |
SRCCHGDATE | CL var for SRCCHGDATE (13) | Character value | Optional |
CRTDATE | CL var for CRTDATE (13) | Character value | Optional |
EXPDATE | CL var for EXPDATE (7) | Character value | Optional |
TEXT | CL var for TEXT (50) | Character value | Optional |
NBRCURRCD | CL var for NBRCURRCD (10 0) | Decimal number | Optional |
NBRDLTRCD | CL var for NBRDLTRCD (10 0) | Decimal number | Optional |
SHARE | CL var for SHARE (4) | Character value | Optional |
DTASPCSIZ | CL var for DTASPCSIZ (15 0) | Not restricted | Optional |
ACCPTHSIZ | CL var for ACCPTHSIZ (12 0) | Not restricted | Optional |
CHGDATE | CL var for CHGDATE (13) | Character value | Optional |
SAVDATE | CL var for SAVDATE (13) | Character value | Optional |
RSTDATE | CL var for RSTDATE (13) | Character value | Optional |
NBRDTAMBRS | CL var for NBRDTAMBRS (2 0) | Decimal number | Optional |
USEDATE | CL var for USEDATE (7) | Character value | Optional |
USECOUNT | CL var for USECOUNT (5 0) | Decimal number | Optional |
RESETDATE | CL var for RESETDATE (7) | Character value | Optional |
Top |
Specifies the name and library of the file that contains the member description that is retrieved.
This is a required parameter.
Note: You must have *USE authority to the file and *READ authority to the library before the member description information can be retrieved.
The possible library values are:
Top |
Specifies the file member whose description is retrieved. Either a single value (*FIRST or *LAST) or a double value (reference member and relationship) can be specified.
The possible single values are:
The possible reference members in double values are:
The possible relationships in double values are:
Top |
Specifies the name of a variable used to retrieve the name of the system from which the file was retrieved. In CL programs, this should be a 4-character variable.
The values that can be returned are *LCL (file found on the local system) and *RMT (file found on a remote system).
Top |
Specifies the name of a variable used to retrieve the name of the library in which the file containing the specified file member is located. In CL programs, this should be a 10-character variable.
Top |
Specifies the name of a variable used to retrieve the name of the file member whose description is being retrieved. In CL programs, this should be a 10-character variable.
Top |
Specifies the name of a variable used to retrieve the file attribute. In CL programs, this should be a 3-character variable.
The values that can be returned are *PF (physical file member) and *LF (logical file member).
Top |
Specifies the name of a variable used to retrieve the file type. In CL programs, this should be a 5-character variable.
The values that are returned are *DATA (data file member) and *SRC (source file member).
Top |
Specifies the name of a variable used to retrieve the source file member type if this is a source file member. Blanks are returned if this is not a source file member. In CL programs, this should be a 10-character variable.
Top |
Specifies the name of a 13-character CL variable used to retrieve the century, date, and time the last source file member was changed. The format is CYYMMDDHHMMSS where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, D = Day, H = Hour, M = Minutes, and S = Seconds.
Blanks are returned if no date is available. Remote non-AS/400 and non-System/38 files or non-source physical file return blanks.
Top |
Specifies the name of a variable used to retrieve the file member creation century, date, and time. In CL programs, this should be a 13-character variable. The format is CYYMMDDHHMMSS where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, D = Day, H = Hour, M = Minutes, and S = Seconds.
Top |
Specifies the name of a variable used to retrieve the file member expiration century and date. In CL programs, this should be a 7-character variable. The format is CYYMMDD where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, and D = Day.
*NONE is returned if no date is available.
Top |
Specifies the name of a variable used to retrieve the file member text. In CL programs, this should be a 50-character variable.
Top |
Specifies the name of a variable used to retrieve the current number of nondeleted records in this file member. In CL programs, this should be a 10-position decimal variable.
If the member is a keyed logical member, the number of index entries is returned. For nonkeyed logical members, the number of nondeleted records in the based-on physical file member is returned.
For a join logical file, the number of records returned is a total of all the nondeleted records in the files being joined. This number includes those records that exist in the secondary file which do not have matching records in the primary file. If omit or select criteria is used, the number of records returned will be reduced or increased by the number of records meeting the selection criteria in the specified files.
Top |
Specifies the name of a variable used to retrieve the current number of deleted records in this file member. In CL programs, this should be a 10-position decimal variable. Zero (0) is returned for keyed logical files. Remote non-AS/400 and non-S/38 files return a value of 0. For nonkeyed logical files, the number of deleted records in the based-on physical file member is returned.
Top |
Specifies the name of a variable used to retrieve a value indicating whether the open data path (ODP) allows sharing with other programs in the same job. In CL programs, this should be a 4-character variable.
Values for ODP sharing are *YES (ODP sharing is allowed) and *NO (ODP sharing is not allowed).
Remote non-AS/400 and non-S/38 files return *NO.
Top |
Specifies the name of a variable used to retrieve the data space size (in bytes) of this file member. In CL programs, this should be a 15-position decimal variable. Zero (0) is returned if this is a logical file member.
Top |
Specifies the name of a variable used to retrieve the access path size (in bytes) for this file member. In CL programs, this should be a 12-position decimal variable. Zero (0) is returned if the file member is non-keyed. Remote non-AS/400 and non-S/38 files return a value of 0.
Top |
Specifies the name of a variable used to retrieve the file change century, date, and time. In CL programs, this should be a 13-character variable. The format is CYYMMDDHHMMSS where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, D = Day, H = Hour, M = Minutes, and S = Seconds.
Top |
Specifies the name of a variable used to retrieve the file member and the save century, date, and time. In CL programs, this should be a 13-character variable. The format is CYYMMDDHHMMSS where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, D = Day, H = Hour, M = Minutes, and S = Seconds.
Blanks are returned if no date is available. Remote non-AS/400 and non-System/38 files return blanks.
Top |
Specifies the name of a variable used to retrieve the file member and restore century, date, and time. In CL programs, this should be a 13-character variable. The format is CYYMMDDHHMMSS where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, D = Day, H = Hour, M = Minutes, and S = Seconds.
Blanks are returned if there is no date available. Remote non-AS/400 and non-System/38 files return blanks.
Top |
Specifies the name of a variable used to retrieve the number of data file members for this logical file member. In CL programs, this should be a 2-position decimal variable. If the member is a physical file member, a value of 0 is returned.
Top |
Specifies the name of a variable used to return the member last used century and date. In CL programs, this should be a 7-character variable. The format is CYYMMDD where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, and D = Day.
Top |
Specifies the name of a variable that is used to return the number of days the member has been used. In CL programs, this should be a 5 decimal variable. If the member does not have a last used date, 0 is returned.
Top |
Specifies the name of a variable that is used to return the century and date the days used count was last reset to 0. In CL programs, this should be a 7-character variable. The format is CYYMMDD where C = Century (0 = 1940 through 1999 and 1 = 2000 through 2039), Y = Year, M = Month, and D = Day. If the days used count has not been reset, blanks are returned.
Top |
Assume the user has a file named MYFILE in library MYLIB (which is the current library) with members QMEMBER, BMEMBER, ZMEMBER, and JMEMBER (created in that order).
Also assume the following variables are specified in the CL program:
DCL &LIB TYPE(*CHAR) LEN(10) DCL &MBR TYPE(*CHAR) LEN(10) DCL &SYS TYPE(*CHAR) LEN(4) DCL &MTYPE TYPE(*CHAR) LEN(5) DCL &CRTDATE TYPE(*CHAR) LEN(13) DCL &CHGDATE TYPE(*CHAR) LEN(13) DCL &TEXT TYPE(*CHAR) LEN(50) DCL &NBRRCD TYPE(*DEC) LEN(10 0) DCL &SIZE TYPE(*DEC) LEN(10 0)
Example 1: Retrieving Member Description Values
RTVMBRD FILE(*CURLIB/MYFILE) MBR(BMEMBER *SAME) + RTNLIB(&LIB) RTNSYSTEM(&SYS) + RTNMBR(&MBR) FILEATR(&MTYPE) + CRTDATE(&CRTDATE) TEXT(&TEXT) + NBRCURRCD(&NBRRCD) DTASPCSIZ(&SIZE)
This command retrieves the member description for member BMEMBER of file MYFILE located using the library list. The requested information is placed in the CL variables as follows:
Example 1: Retrieving the Next Member Description
RTVMBRD FILE(&LIB/MYFILE) MBR(&MBR *NEXT) + RTNMBR(&MBR) CRTDATE(&CRTDATE) + TEXT(&TEXT) NBRCURRCD(&NBRRCD) + DTASPCSIZ(&SIZE)
This command retrieves the member description for the member of file MYFILE which is "next" (in name order). The requested information is placed in the CL variables as follows:
The file can also be searched backwards. An example is:
RTVMBRD FILE(*CURLIB/MYFILE) MBR(ZMEMBER *PRV) + RTNMBR(&MBR) CHGDATE(&CHGDATE) TEXT(&TEXT)
The requested information is placed in the CL variables as follows:
If only the first part of the member name is known, you can use a generic name (or partial name) search of the list of members, as follows:
RTVMBRD FILE(*LIBL/MYFILE) MBR(JM*) RTNMBR(&MBR) + CHGDATE(&CHGDATE) TEXT(&TEXT)
The requested information is placed in the CL variables as follows:
Top |
*ESCAPE Messages
Top |