Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Reorganize Physical File Member (RGZPFM) command removes deleted records from (compresses) one member of a physical file in the database, and it optionally reorganizes that member.
If a keyed file is identified in the Key file (KEYFILE) parameter, the system reorganizes the member by changing the physical sequence of the records in storage to either match the keyed sequence of the physical file member's access path, or to match the access path of a logical file member that is defined over the physical file. Reorganization can decrease file processing time when a program is reading sequentially through a keyed physical file or through a keyed logical file.
When the member is reorganized and KEYFILE(*NONE) is not specified, the sequence in which the records are actually stored is changed, and any deleted records are removed from the file. If KEYFILE(*NONE) is specified or defaulted, the sequence of the records does not change, but deleted records are removed from the member. Optionally, new sequence numbers and zero date fields are placed in the source fields of the records. These fields are changed after the member has been compressed or reorganized.
Notes:
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | Data base file | Qualified object name | Required, Positional 1 |
Qualifier 1: Data base file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MBR | Member | Name, *FIRST, *LAST | Optional, Positional 2 |
KEYFILE | Key file | Single values: *NONE, *FILE, *RPLDLTRCD Other values: Element list |
Optional |
Element 1: Logical file | Qualified object name | ||
Qualifier 1: Logical file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
Element 2: Member | Name | ||
RBDACCPTH | Rebuild access paths | *YES, *OPTIMIZE, *NO | Optional |
ALWCANCEL | Allow cancel | *NO, *YES | Optional |
LOCK | Lock state | *EXCL, *EXCLRD, *SHRUPD | Optional |
SRCOPT | Source update options | Single values: *SAME Other values (up to 2 repetitions): *SEQNBR, *DATE |
Optional |
SRCSEQ | Source sequence numbering | Element list | Optional |
Element 1: Starting sequence number | 0.01-9999.99, 1.00 | ||
Element 2: Increment number | 0.01-9999.99, 1.00 | ||
RCDFMT | Record format | Name, *ONLY | Optional |
Top |
Specifies the physical file whose member is to be reorganized.
This is a required parameter.
Qualifier 1: Data base file
Qualifier 2: Library
Top |
Specifies the member to be reorganized.
Top |
Specifies whether the physical file member has its arrival sequence changed to match its keyed sequence, is reorganized in the sequence of a logical file member, or is not reorganized. If this parameter specifies a multiple-format logical file and member, the Record format (RCDFMT) parameter must also be specified.
Note: Join logical files cannot be specified as key files, and a logical file in this parameter is not allowed to have a select/omit access path.
Single values
Element 1: Logical file
Specify the name and library of the logical file associated with the physical file member.
Qualifier 1: Logical file
Qualifier 2: Library
Element 2: Member
Top |
Specifies whether to rebuild or maintain any valid access paths (other than an access path specified as the KEYFILE or a MAINT(*REBLD) access path) over the member.
If *NO is specified, ALWCANCEL(*YES) must also be specified.
Top |
Specifies whether to allow the reorganize to be canceled.
If *NO is specified, KEYFILE(*RPLDLTRCD) and RDBACCPTH(*NO) must not be specified, and LOCK(*EXCL) must also be specified.
Top |
Specifies the lock to acquire on the physical file member. The lock state will determine how much concurrent access is allowed by other jobs during the reorganize.
If *EXCLRD is specified, ALWCANCEL(*YES) must also be specified.
If *SHRUPD is chosen, the resulting order of the rows may not exactly match what was requested on the KEYFILE keyword. The rows will be reorganized to closely match the specified order, but concurrent update, delete, and insert operations will cause some rows to not be reorganized. If the rows must exactly match the arrival sequence (*NONE) or a keyed file sequence, do not use *SHRUPD.
If *SHRUPD is specified, ALWCANCEL(*YES) must also be specified.
Note: Additional details about lock states can be found in the CL information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies, for physical source files only, whether the member places new numbers in the sequence number field, places zeros in the date field, or changes both fields. Changes occur after the records are compressed or reorganized.
Single values
Other values
Top |
Specifies, only when *SEQNBR is also specified on the SRCOPT parameter, the sequence number that is given to the first record in the source file member and the increment value that is used to renumber all other records in the member. If the member is renumbered but this parameter is not specified, 1.00 is assumed for sequence number and increment value.
Element 1: Starting sequence number
Element 2: Increment number
For example, if SRCSEQ(5000 10) is specified, the first record in the reorganized member is numbered 5000.00, the second is 5010.00, the third is 5020.00, and so on. If SRCSEQ(*N .25) is specified, the records are numbered 1.00, 1.25, 1.50, 1.75, 2.00, and so on. If a starting value of .01 and an increment value of .01 are specified, there are 999,999 unique sequence numbers possible. If the maximum sequence number of 9999.99 is reached, the remaining records are also assigned the sequence number 9999.99.
Top |
Specifies the record format name if the physical file member is reorganized in the sequence of a multiple-format logical file.
Top |
Example 1: Reorganizing by Deleting Records
RGZPFM FILE(PAYROLL) MBR(MBR1)
This command compresses member MBR1 of the PAYROLL file by removing the deleted records from the file member.
Example 2: Reorganizing by Replacing Deleted Records
RGZPFM FILE(PAYROLL) MBR(MBR1) KEYFILE(*RPLDLTRCD) ALWCANCEL(*YES) LOCK(*EXCLRD)
This command compresses member MBR1 of the PAYROLL file by replacing deleted records at the start of the file with valid records from the end of the file. The command may be canceled and other jobs are allowed to read data from the PAYROLL file while the reorganize is in progress.
Example 3: Reorganizing in Keyed Sequence
RGZPFM FILE(QCLSRC) MBR(CLMBR2) SRCOPT(*SEQNBR *DATE) KEYFILE(*FILE) SRCSEQ(1.00 .25)
This command reorganizes the member CLMBR2 of the CL source file QCLSRC in keyed sequence, with the sequence number field used as the key. The reorganized member has new sequence numbers (starting at 1.00 and incrementing by .25) and a null date (000000) placed in all records when the original member is reorganized.
Top |
*ESCAPE Messages
*NOTIFY Messages
Top |