Examples using the delete rules
The following series of figures shows the use of the delete rules for each of the segment types for which the delete rule can be coded (logical and physical parents and their logical children).
Only the rule pertinent to the example is shown in each figure. The explanation accompanying the example applies only to the specific example.


GHU 'LOANS' STATUS=' '
DLET STATUS=' '
The physical delete rule requires that all logical children be previously physically deleted. Physical dependents of the logical parent are physically deleted.
The DLET status code will be 'DX' if all of the logical children were not previously physically deleted. All logical children are logically deleted. The LD bit is set on in the physical logical child BORROW.


GHU 'CUSTOMER' STATUS=' '
DLET STATUS=' '
- All logical children be previously physically deleted.
- Physical children paired to the logical child be previously deleted.
CUSTOMER, the logical parent, has been physically deleted. Both the logical child and its pair had previously been physically deleted. (The PD and LD bits are set on the before figure of the BORROW/LOANS.)


GHU 'LOANS' STATUS=' '
DLET STATUS=' '
The logical delete rule allows either physical or logical deletion first; neither causes the other. Physical dependents of the logical parent are physically deleted.
The logical parent LOANS remains accessible from its logical children. All logical children are logically deleted. The LD bit is set on in the physical child BORROW.
The processing and results shown in Figure 7 would be the same if the logical parent LOANS delete rule were virtual instead of logical. The example that follows is an additional one to explain the logical delete rule.


GHU 'LOANS' STATUS=' '
DLET STATUS=' '
The logical delete rule allows either physical or logical deletion first; neither causes the other. Physical dependents of the logical parent are physically deleted.
The logical parent LOANS remains accessible from its logical children. All physical children are physically deleted. Paired logical children are logically deleted.
The processing and results shown in Figure 10 would be the same if the logical parent LOANS delete rule were virtual instead of logical. An additional example to explain the virtual delete rule follows in the following figure.


GHU 'CUSTOMER'
'BORROW/LOANS' STATUS=' '
DLET STATUS=' '
The virtual delete rule allows explicit and implicit deletion. Explicit deletion is the same as using the logical rule. Implicit deletion causes the logical parent to be physically deleted when the last logical child is physically deleted.
Physical dependents of the logical child are physically deleted. The logical parent is physically deleted. Physical dependents of the logical parent are physically deleted. The LD bit is set on in the physical logical child BORROW.


GHU 'CUSTOMER'
'BORROW/LOANS' STATUS=' '
DLET STATUS=' '
The virtual delete rule allows explicit and implicit deletion. Explicit deletion is the same as using the logical rule. Implicit deletion causes the logical parent to be physically deleted when the last logical child is physically and logically deleted.
The logical parent is physically deleted. Any physical dependents of the logical parent are physically deleted.


GHU 'LOANS'
'CUSTOMER' STATUS=' '
DLET STATUS=' '
The bidirectional virtual rule for the physical parent has the same effect as the virtual rule for the logical parent.
When the last logical child is logically deleted, the physical parent is physically deleted. The logical child (as a dependent of the physical parent) is physically deleted. All physical dependents of the physical parent are physically deleted. That is, ACCOUNTS (not shown), BORROW, and PAYMENT are physically deleted.

GHU 'LOANS' STATUS=' '
'CUST/CUSTOMER'
DLET STATUS=' '
GHU 'CUSTOMER' STATUS=' '
'BORROW/LOANS'
DLET STATUS=' '
The physical delete rule requires that the logical child be logically deleted first. The LD bit is now set in the BORROW segment.
The logical child can be physically deleted only after being logically deleted. After the second delete, the LD and PD bits are both set. The physical delete of the logical child also physically deleted the physical dependents of the logical child. The PD bit is set.


GHU 'CUSTOMER STATUS=' '
'BORROW/LOANS'
DLET STATUS=' '
GHU 'LOANS' STATUS=' '
'CUST/CUSTOMER'
DLET STATUS=' '
The logical delete rule allows the logical child to be deleted physically or logically first. Physical dependents of the logical child are physically deleted, but they remain accessible from the logical path that is not logically deleted.
The delete of the virtual logical child sets the LD bit on in the physical logical child BORROW (BORROW is logically deleted).


GHU 'CUSTOMER STATUS=' '
'BORROW/LOANS'
DLET STATUS=' '
GHU 'LOANS' STATUS=' '
'CUST/CUSTOMER'
DLET STATUS=' '
With the physical or logical delete rule, each logical child must be deleted from its physical path. Physical dependents of the logical child are physically deleted, but they remain accessible from the paired logical child that is not deleted.
Physically deleting BORROW sets the LD bit on in CUST. Physically deleting CUST sets the LC bit on in the BORROW segment.


GHU 'CUSTOMER STATUS=' '
'BORROW/LOANS'
DLET STATUS=' '
GHU 'LOANS' STATUS='GE'
'CUST/CUSTOMER'
The virtual delete rule allows the logical child to be deleted physically and logically. Deleting either path deletes both parts. Physical dependents of the logical child are physically deleted.
The previous delete deleted both paths because the delete rule is virtual. Deleting either path deletes both.


GHU 'CUSTOMER STATUS=' '
DLET STATUS=' '
GHU 'LOANS' STATUS='GE'
'CUST/CUSTOMER'
With the virtual delete rule, deleting either logical child deletes both paired logical children. (Notice the PD and LD bit is set on in both.) Physical dependents of the logical child are physically deleted.
Physical dependents of the logical child are physically deleted.
