Deleting segments
When segments are deleted from a HISAM database, they are marked as deleted in the delete byte in their prefix. They are not physically removed from the database; the one exception to this is discussed later in this topic.
Dependent segments of the deleted segment are not marked as deleted, but because their parent is, the dependent segments cannot be accessed. These unmarked segments (as well as segments marked as deleted) are deleted when the database is reorganized.
One thing you should note is that when a segment is accessed that hierarchically follows deleted segments in a database record, the deleted segments must still be “searched through”. This concept is shown in the following figures.
Segment B2 is deleted from this database record. This means that segment B2 and its dependents (C1, C2, and C3) can no longer be accessed, even though they still exist in the database.

A request to access segment D1 is made. Although segments B2, C1, C2, and C3 cannot be accessed, they still exist in the database. Therefore they must still be “searched through” even though they are inaccessible as shown in the following figure.

In one situation, deleted segments are physically removed from the database. If the deleted segment is a root, the logical record containing the root is erased, provided neither the root nor any of its dependents is involved in a logical relationship. The default is ERASE=YES, and no "mark buffer altered" takes place. Thus a PROCOPT=G read job will not have to wait for locks after another job has set the delete byte, and will return a segment not found condition. To be consistent with other DB types, use ERASE=NO to cause a wait for physical delete prior to attempted read. The ERASE parameter is specified on the DBD statement of the DFSVSMxx PROCLIB member.
After the logical record is removed, its space is available for reuse. However, any overflow logical record containing dependents of this root is not available for reuse. Except for this special condition, you must unload and reload a HISAM database to regain space occupied by deleted segments.