Documentation >
MAC-PAC Technical Library >
Distribution >
Order Processing >
Programs >
Sales Order History File Purge - Purpose
Sales Order History File Purge - Purpose
OP090E
The Sales Order History File Purge program (OP090E) deletes records from the Sales Order History file (OP120M) and the Sales Order Discount Detail History file (OP120M2). Records are only deleted from OP120M if they fall before the purge horizon date. Any records deleted from OP120M will have their related records deleted from OP120M2.
The program reads the Sales Analysis Install Flag on Reference File category 012 to determine which records to select for deletion. If this flag is set to 'N', the program reads OP120ML6 to select those records not posted to the Sales Analysis file (SA100M). If this flag is set to 'Y', the program reads OP120ML4 to select only those records that have been posted to the Sales Analysis file.
A report is printed listing the number of records deleted. This purge program is called from the File Support Option on the System Processing Menu, where a horizon date is entered. All records eligible for deletion are deleted up to but not including the horizon date. The Control Language program which calls the purge program reorganizes the Sales Order History file and the Sales Order Discount Detail History file after this program finishes.