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

Parameters

FILE Data base file

Specifies the physical file whose member is reorganized. This parameter is required.

Type
*QUAL
Required
Yes
Case
Uppercase
*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

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

MBR Member

Specifies the member to reorganize.

Type
*NAME
Required
No
Default
*FIRST
Length
10
Case
Uppercase

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.

Type
*ELEM
Required
No
Default
*NONE
Case
Uppercase

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

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Logical file Logical file

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

Member Member

Type
*NAME
Required
No
Length
10
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*YES
Length
9
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*EXCL
Length
7
Case
Uppercase

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.

Type
*UINT4
Required
No
Default
*START
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*SAME
Length
7
List limit
2
Case
Uppercase

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.

Type
*ELEM
Required
No
Case
Uppercase
Elements in order

Starting sequence number Starting sequence number

Type
*DEC
Required
No
Default
1.00
Length
6, 2 decimals
Range
0.01 to 9999.99
Case
Uppercase

Increment number Increment number

Type
*DEC
Required
No
Default
1.00
Length
6, 2 decimals
Range
0.01 to 9999.99
Case
Uppercase

RCDFMT Record format

Type
*NAME
Required
No
Default
*ONLY
Length
10
Case
Uppercase

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.

IBM command documentation

Generated from os/cl/catalog/RGZPFM.json and os/cl/help/RGZPFM.json.