Command reference / db
RGZPFM
Reorganize Physical File Mbr
Removes deleted records from (compresses) one member of a physical file, and optionally reorganizes that member. If KEYFILE names a keyed file or logical file, the member's records are physically re-sequenced to match that access path, which can speed sequential reads. With KEYFILE(*NONE) the record order is unchanged and only deleted records are removed. Optionally, new sequence numbers and zero date fields are placed in source records after the reorganize.
Allowed environments: *ALL.
Positional parameters: 2.
Restrictions
- The file is locked during the reorganize. The LOCK parameter sets how much concurrent access other jobs get.
- Requires object operational, object management or alter, and all data authority to the physical file, plus execute authority to its library. Object operational authority to the KEYFILE file and execute authority to its library are also required.
- In multithreaded jobs, not threadsafe for distributed files that use *SNA relational databases, and fails for DDM files of type *SNA.
Parameters
FILE
Data base file
Specifies the physical file whose member is reorganized. This parameter is required.
*LIBL- Searches all libraries in the thread's library list until the first match.
*CURLIB- Uses the thread's current library. If none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Data base file
Data base file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
MBR
Member
Specifies the member to reorganize.
Suggested / special values:
*FIRST, *LAST
*FIRST- The first, or only, member in the file.
*LAST- The last, or only, member in the file.
KEYFILE
Key file
Specifies whether the member's arrival sequence changes to match its keyed sequence, whether it is reorganized in a logical file member's sequence, or whether it is not reorganized. For a multiple-format logical file, RCDFMT must also be specified.
Suggested / special values:
*NONE, *FILE, *RPLDLTRCD
*NONE- Not reorganized. Deleted records are removed and nothing else changes.
*RPLDLTRCD- Reorganized by replacing deleted records at the start of the file with valid records from the end. Do not use if records must keep their exact arrival sequence.
*FILE- For a physical member with a keyed access path, the arrival sequence changes to match the keyed sequence.
Elements in order
Logical file
Logical file
Qualified parts (object, then library; write LIBRARY/OBJECT)
Logical file
Logical file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
Member
Member
RBDACCPTH
Rebuild access paths
Specifies whether valid access paths over the member, other than the KEYFILE access path or MAINT(*REBLD) access paths, are rebuilt or maintained.
Allowed values:
*YES, *OPTIMIZE, *NO
*YES- Access paths are rebuilt synchronously at the end of the reorganize.
*OPTIMIZE- Access paths are rebuilt asynchronously afterward or maintained during the reorganize, whichever is faster.
*NO- Access paths are maintained during the reorganize. Requires ALWCANCEL(*YES).
ALWCANCEL
Allow cancel
Specifies whether the reorganize can be canceled.
Allowed values:
*NO, *YES
*NO- The reorganize cannot be canceled. If the job ends before it finishes, changes made so far are discarded.
*YES- The reorganize can be canceled. A later reorganize with the same parameters typically continues where it stopped.
LOCK
Lock state
Specifies the lock acquired on the member, which determines how much concurrent access other jobs have during the reorganize.
Allowed values:
*EXCL, *EXCLRD, *SHRUPD
*EXCL- Exclusive lock. No concurrent access from other jobs.
*EXCLRD- Exclusive allow-read lock. Other jobs may read. Requires ALWCANCEL(*YES).
*SHRUPD- Shared update lock. Other jobs may update, delete, and insert, so the final record order may not exactly match the request. Requires ALWCANCEL(*YES).
FROMRCD
From record
Specifies the record number where reorganization starts. Only records from that record to the end of the file are reorganized.
Suggested / special values:
*START, *PRVRGZ
*START- All records in the file are reorganized.
*PRVRGZ- Starts where the previous reorganize could not remove all deleted records, or at the first record if the previous one completed. Requires ALWCANCEL(*YES) and KEYFILE(*RPLDLTRCD) or KEYFILE(*NONE).
SRCOPT
Source update options
For physical source files only: specifies whether sequence numbers are renumbered, date fields are set to zero, or both, after the reorganize.
Allowed values:
*SAME, *SEQNBR, *DATE
*SAME- Sequence number and date fields do not change.
*SEQNBR- New sequence numbers are placed in the sequence number field, using the start and increment in SRCSEQ.
*DATE- A null date (000000) is placed in the date field.
SRCSEQ
Source sequence numbering
Used only with SRCOPT(*SEQNBR). Gives the sequence number of the first record and the increment for the rest. If not specified, 1.00 is used for both.
Elements in order
Starting sequence number
Starting sequence number
Increment number
Increment number
RCDFMT
Record format
Suggested / special values:
*ONLY
Examples
RGZPFM FILE(PAYROLL) MBR(MBR1)
Compresses member MBR1 of PAYROLL by removing deleted records. Record order is unchanged.
RGZPFM FILE(PAYROLL) MBR(MBR1) KEYFILE(*RPLDLTRCD) ALWCANCEL(*YES) LOCK(*EXCLRD)
Compresses MBR1 by replacing deleted records at the start with valid records from the end. The command can be canceled, and other jobs can read PAYROLL while it runs.
Generated from os/cl/catalog/RGZPFM.json and os/cl/help/RGZPFM.json.