Documentation >
MAC-PAC Technical Library >
Distribution >
Synchro >
Programs >
Synchro Files Reorganization (RPG) - Purpose >
Synchro Files Reorganization (RPG) - Calculations
Synchro Files Reorganization (RPG) - Calculations
GA020E
A. The purged files saving periods record is retrieved from the Reference File from category G19.
B. Mainline
1. Depending on the file to be purged (input parameter FILKEY), the following subroutines are called by MAINLN:
a. If FILKEY is 'GN' (Offset Release file), subroutine ROPURG is called. ROPURG reads only the offset releases with release status 'C' (closed) using the logical GA200ML6. The record to be deleted is written to GA020PF1 and the record is deleted from the Offset Release file (GA200M).
b. If FILKEY is 'GG' (Endorsement Master, Endorsement Comments), subroutine ENPURG is called. ENPURG reads all endorsements by descending validity date (logical GA120MLL). If an endorsement is marked as pending delete (activity code flag ENACTC is 'D'), the record is deleted by calling subroutine ENDDLT. ENDDLT can delete endorsements even if they are not marked to be deleted, according to the following rules:
· the validity date (ENVADT on GA120M3) plus the time the user wants to keep endorsements in the system after they are invalid (set in category G19 in RG19EN) are before the minimum date given as an input parameter (PARDAT) and the actual date minus the period specified in RG19EN:
ENVADT + RG19EN <= min {PARDAT; today - RG19EN}
· there are still the number of endorsements saved in the system that were specified in category G19 (RG19EE).
ENDDLT writes the record to be deleted to GA020PF1 and deletes it from the Endorsement Master (GA120M3). The subroutine also deletes all attached endorsement comments from the Endorsement Comment file (GA120M4).
c. If FILKEY is 'GB' (Delivery Point Master), subroutine DCPURG is called. DCPURG reads only the delivery points with release status 'D' (closed), using the logical file GA100ML5. The record to be deleted is written to GA020PF1 and the record is deleted from the Delivery Point Master (GA100M1).
d. If FILKEY is 'GD' (Exception Dates), subroutine EDPURG is called. EDPURG deletes all records from the Exception Date file (GA105M) with an exception date before the minimum date given as an input parameter (PARDAT) and the actual date minus the period specified in RG19ED (the time that the user wants to keep the dates in the system after they are passed):
Exception date <= min {PARDAT; today - RG19ED}
The records to be deleted are written to GA020PF1.