MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Distribution > Purchasing > Programs > Purchasing Statistics Update - Purpose > Purchasing Statistics Update - Calculations

Purchasing Statistics Update - Calculations

PO260E

A.   Housekeeping

1.   See Common Processing Routines - Housekeeping of this manual for a general discussion of the Housekeeping subroutine.  Processing specific to this program is described below.

2.   Key lists are defined for each file retrieved by the program.

3.   Workfields are defined and program constants are initialized.

4.   The following records are retrieved from the Reference file (REFERP):

a.   The purchasing period calendar (category 490) is retrieved.

b.   The last purchasing period posted is retrieved from the purchasing statistics posting periods record (category 488).

5.   The current posting period is determined by adding one to the last purchasing period posted.  If the last purchasing period was 12 in a year calendar or 13 in a period calendar, the current posting period is set to one.

6.   The current posting period ending date is determined by comparing the current posting period with the purchasing period calendar.

B.   Mainline

1.   The Item/Vendor Statistics file is updated.

a.   The Item/Vendor Statistics file (PO280M) is read sequentially.

b.   For each record read, the current field values are moved to save fields for later updating the analysis file.

c.   If the current period is the last purchasing period of the year (period 12 for a year calendar or period 13 for a period calendar), the current year-to-date fields are rolled into the prior-year fields.  The current year-to-date fields are then set equal to the next period fields.

d.   If the current period is not the last purchasing period of the year, the next period fields are added to the year-to-date fields.

e.   The current fields are set to the next period field values, and the next period fields are set to zero.

f.    The Accepted and Rejected Quantities and the Volume at Standard Cost for the current period, year to date, and last year are checked for activity.

(1)  If all fields are zero, indicating there has been no activity for two years, the record is deleted from the statistics file (PO280M).  All corresponding item/vendor records for all periods are then sequentially deleted from the Item/Vendor Analysis file (PO270M).  A record is written for every record deleted for printing on the report.

(2)  If activity has occurred, an analysis record is written to the Item/Vendor Analysis file (PO270M) using the saved current period fields from the statistics record.

2.   The Item/Buyer Statistics file is updated.

a.   The Item/Buyer Statistics file (PO260M) is read sequentially.

b.   For each record read, the current field values are moved to save fields for later updating the analysis file.

c.   If the current period is the last purchasing period of the year (period 12 for a year calendar or period 13 for a period calendar), the current year-to-date fields are rolled into the prior-year fields.  The current year-to-date fields are then set equal to the next period fields.

d.   If the current period is not the last purchasing period of the year, the next period fields are added to the year-to-date fields.

e.   The current fields are set to the next period field values, and the next period fields are set to zero.

f.    The Accepted and Rejected Quantities and the Volume at Standard Cost for the current period, year to date, and last year are checked for activity.

(1)  If all fields are zero, indicating there has been no activity for two years, the record is deleted from the statistics file (PO260M).  All corresponding item/buyer records for all periods are then sequentially deleted from the Item/Buyer Analysis file (PO300M).  A record is written for every record deleted for printing on the report.

(2)  If activity has occurred, an analysis record is written to the Item/Buyer Analysis file (PO300M) using the saved current period fields from the statistics record.

3.   The Vendor Purchase History file is updated.

a.   The Vendor Purchase History file (PO290M) is read sequentially.

b.   If the current period is the last purchasing period of the year (period 12 for a year calendar or period 13 for a period calendar), the current year-to-date fields are rolled into the prior-year fields.  The current year-to-date fields are then set equal to the next period fields.

c.   If the current period is not the last purchasing period of the year, the next period fields are added to the year-to-date fields.

d.   The current fields are set to the next period field values, and the next period fields are set to zero.

e.   The Accepted and Rejected Amounts for the current period, year to date, and last year are checked for activity.  If all fields are zero, indicating there has been no activity for two years, the record is deleted from the Vendor Purchase History file (PO290M).  A record is written for every record deleted for printing on the report.

C.   Windup

1.   The purchasing statistics posting periods record (category 488) on the Reference file is updated with the purchasing period just posted.

PO260E Program Menu