Making batch data deletions in a IMS Universal DL/I driver application
Use the batchDelete method in the PCB interface to delete multiple existing segments in the database with one call.
Procedure
- Obtain an unqualified SSAList instance from the PCB instance representing the database.
-
Optionally, you can add qualification statements to the SSAList.
See
Specifying segment search arguments using the SSAList
for more information. - Call the batchDelete method to delete the segments specified by the SSAList in the previous steps.
The following code fragment illustrates how to use the batchDelete
method to remove a patient's records. The SSAList instance is set to restrict the
deletion operation to remove only records where the patient name is ANDREA SMITH
, the ward
name is SURG
, and the hospital name is
ALEXANDRIA
.
SSAList ssaList = pcb.getSSAList("HOSPITAL","PATIENT");
ssaList.addInitialQualification("HOSPITAL","HOSPNAME",SSAList.EQUALS,"ALEXANDRIA");
ssaList.addInitialQualification("WARD","WARDNAME",SSAList.EQUALS,"SURG");
ssaList.addInitialQualification("PATIENT","PATNAME",SSAList.EQUALS,"ANDREA SMITH");
pcb.batchDelete(ssaList);Important: To persist changes made to the database, your application must call
the PSB.commit method prior to deallocating the PSB, otherwise the changes are rolled back up to the
last point commit was
called.