Documentation >
MAC-PAC Technical Library >
Manufacturing >
Just-in-Time >
Programs >
Production Schedule Firm/Unfirm - Batch - Purpose >
Production Schedule Firm/Unfirm - Batch - Calculations
Production Schedule Firm/Unfirm - Batch - Calculations
JT230E
A. Housekeeping
1. See the Common Processing Routines - Housekeeping section of this manual for a general discussion of the Housekeeping subroutine. Processing specific to this program is discussed below.
2. Key lists and parameters are defined.
3. Workfields are defined and program constants are initialized.
4. The following information is retrieved from the Reference file (REFERP).
a. The operating system's file status codes (category 015) are retrieved. If this record is not found, the program terminates.
b. The date format (category 049) is retrieved. If this record is not found, MMDDYY is chosen as the default.
c. The next flow authorization number (category C09) is retrieved. If this record is not found, the program terminates.
d. Category 409 is read to determine which plants the user is authorized to.
5. The company name is retrieved from the System Control file (CT100M).
B. Mainline
1. The Production Schedule Firm/Unfirm Request file (JT330AP) is read sequentially. Based on the record read, the program status field (PGMSTS) is formatted to process that request. The program status controls the processing of the program.
If the request code is equal to 1 (firm) and the cell number (CZCELL) is not blank, PDCFRM is moved to the Program Status field. If the part number field is equal to ALL, then ALLFRM is moved to the Program Status field, otherwise, PRTFRM is moved to the Program Status field.
If the request code is equal to 2 (unfirm) and the cell number (CZCELL) is not blank, PDCUNF is moved to the Program Status field. If the part number field is equal to ALL, then ALLUNF is moved to the Program Status field, otherwise, PRTUNF is moved to the Program Status field.
2. If the program status is equal to PRTFRM, then FIRMPT is executed. This routine validates the part number for the specified plant and then reads all flow authorization records for the part and its main production center (from the Part Master file) that start before the user-entered horizon date. For each qualifying flow authorization record, FAFIRM is executed, to change the status of the flow authorization record.
3. If the program status is equal to PDCFRM, then FIRMPC is executed. This routine validates the production center number for the specified plant and then reads all parts whose main production center is that production center. Then the part number is validated to see if it qualifies to have any flow authorization records. If no errors occurred in the validation, all flow authorization records for the part that start before the user-entered horizon date are read. For each qualifying flow authorization record, FAFIRM is executed to change the status of the flow authorization record.
4. If the program status is equal to ALLFRM, then FIRMAL is executed. This subroutine reads through the entire Part Master file (DE100ML16). Then the part number for the specified plant is validated to see if it qualifies to have any flow authorization records. If no errors occurred in the validation, then all flow authorization records for the part which start before the user-entered horizon date are read.
For each qualifying flow authorization record, FAFIRM is executed to change the status of the flow authorization record.
5. If the program status is equal to PRTUNF, then UNFRPT is executed. This subroutine validates the part number for the specified plant, to see if it qualifies to have any flow authorization records. If no error occurred in the validation, then all flow authorization records for the part and its main production center that end after the user-entered horizon date are read. For each qualifying flow authorization record, FAUNFR is executed to change the status of the flow authorization record.
6. If the program status is equal to PDCUNF, then UNFRPC is executed. This routine validates the production center number for the specified plant and reads all parts whose main production center is that production center. Then the part number is validated to see if it qualifies to have any flow authorization records. If no error occurred in the validation, then all flow authorization records for the parts that end after the user-entered horizon date are read. For each qualifying flow authorization record, FAUNFR is executed to change the status of the flow authorization record.
7. If the program status is equal to ALLUNF, then UNFRAL is executed. This subroutine reads the entire Part Master file (DE100ML16). Then the part number for the specified plant is validated to see if it qualifies to have any Flow Authorization records. If no error occurred in the validation, then all flow authorization records for the parts that end after the user-entered horizon date are read. For each qualifying flow authorization record, FAUNFR is executed to change the status of the flow authorization record.
8. After the proper subroutine is executed, the next request record is read from the Production Schedule Firm/Unfirm Request file (JT330AP) until no more requests remain. Then the Reference file (REFERP) is updated with the new flow authorization number, and the program terminates.