Example: Reorganize a physical file

The examples in this topic show how to reorganize physical files with the Reorganize Physical File Member (RGZPFM) command.

For example, the following RGZPFM command reorganizes the first member of a physical file using an access path from a logical file:
RGZPFM  FILE(DSTPRODLB/ORDHDRP)
        KEYFILE(DSTPRODLB/ORDFILL  ORDFILL)

The physical file ORDHDRP has an arrival sequence access path. It was reorganized using the access path in the logical file ORDFILL. Assume the key field is the Order field. The following example shows how the records were arranged.

This table shows the original ORDHDRP file. Note that record 3 was deleted before the RGZPFM command was run.

Relative record number Cust Order Ordate. . .
1 41394 41882 072480. . .
2 28674 32133 060280. . .
3 deleted record  
4 56325 38694 062780. . .

This table shows the ORDHDRP file reorganized using the Order field as the key field in ascending sequence.

Relative record Number Cust Order Ordate. . .
1 28674 32133 060280. . .
2 56325 38694 062780. . .
3 41394 41882 072480. . .