Detecting physical delete rule violations

When a DLET call is issued, the delete routine scans the physical structure containing the segment to be deleted.

The delete routine scans the physical structure to determine if any segment in it uses the physical delete rule and whether that rule is being violated. The following figure and code sample show an example of violating the physical delete rule.

Figure 1. Example of violation of the physical delete rule
SEG1 (L) has child SEG2 (LP), which has VLC SEG3. SEG4 (LP, L) has child SEG5 (LC, V), which has child SEG6 (PP), which has child SEG7 (PD, LC). SEG8 (PD, LP, L) has child SEG9 (LD, LC, V). PCB: SEG4.
Figure 2. Example of violation of the physical delete rule: database calls
GHU 'SEG4'  STATUS='  '
DLET        STATUS='DX'

SEG7 (the logical child of SEG2) uses the physical delete rule and has not been logically deleted (the LD bit has not been set on). Therefore, the physical delete rule is violated. A 'DX' status code is returned to the application program, and no segments are deleted.