Type
Control Command

Purpose
The reorganize command reorganizes the specified table by updating the table's indices and physically erasing deleted records from disk.
The reorganize command functions like selecting Application>>Utilities>>Reorganize.

Syntax
reorganize "TABLENAME" [UNCLUSTERED|CLUSTERBY FIELD1 [ ; FIELD2...]] .

Usage
The reorganize command, used by itself, reorganizes the specified table as described above. If the table contains a clustered index, the records are reorganized according to the table-defined cluster order.
The tablename must be enclosed in quotes.
When a table is reorganized, all records that have been deleted since the last reorganization are permanently erased and all indices used to organize the data in the table are recreated.
If the table has become inconsistent (signaled by an error message), the reorganize command reorganizes the records in the table and returns the table to a consistent status.
The reorganize unclustered command overrides any table-defined cluster order. DataEase reorganizes the table in unclustered order. Any records entered since the table was last reorganized are left in the order they were entered.
The reorganize cluster by command lets you override the table-defined cluster order. The table is reorganized in order according to the field name(s) you specify. DataEase prohibits you from including any fields specified in the table-defined cluster order.
LAN
On a LAN (Local Area Network), if another user is currently using any resource required by the reorganize command, DataEase displays a Resource Conflict message. While this message is displayed, DataEase automatically tries to execute the command at brief intervals.
When the required resource becomes available, DataEase automatically resumes processing and executes the rest of the procedure.

Example 1
reorganize "MEMBERS" .
run report "PRINT INVOICES" .

This script tells DataEase: (1) Reorganize the MEMBERS table, and (2) when the reorganization is completed, run the PRINT INVOICES procedure.

Example 2
reorganize "DEPARTURE ZONES" cluster by DEPARTURE ZONE .

This script tells DataEase to reorganize the DEPARTURE ZONES table. Cluster the data in order by the DEPARTURE ZONE field.