1.Functional Description
1.1Purpose
This function reads the Rated and Loaded Capacity arrays to calculate the gross capacity. If the
gross capacity is outside the range specified in the input percent parameters, the function writes
Over/Under Capacity messages to F3311. The function also creates capacity load records in F3313.
1.2Setup Notes and Prerequisites
The calling application must call B3300140, RRP, Initialize Bucket Dates, before calling this
function. The Bucket Date Array pointer returned by B3300140 must be passed as input to this function.
The calling application must call B3300150 (RRP, Calculate Rated Capacity) and B3300160 (RRP,
Calculate Loaded Capacity) to allocate and load the Rated and Loaded Capacity arrays.
1.3Special Logic
2.Technical Specifications
message records
CummTotal = 0
CNCAPM = '1'
CNMCU = WorkCenter
CNUM = UnitOfMeasure
CNHCLD = 'A'
CNPID = "R3380"
Call B9800100 to get the current date (CNUPMJ), time (CNTDAY), workstation ID (CNJOBN), and user
ID (CNUSER).
Do X = 1 to NumberOfPeriods
If BucketDateArray[X] > 0
If PastDuePeriods <> 0 or X > 1
If RatedCapacityArray[X] <> 0
PCT = LoadedCapacityArray[X] / RatedCapacityArray[X]
PCT = PCT * 100
Else
PCT = 0
End
// If percentage is outside the processing option range, write a
message to F3311
If PCT <= UnderCapacityPercent and RatedCapacityArray[X] <> 0 and
PastDuePeriods < X
Call B3100490 to get the next Unique ID (CNUKID) value
Write a message to F3311 with field values CNCMSG = 'U',
LoadedCapacityArray[X],
CNUORG = RatedCapacityArray[X].
Write a message to F3311 with field values CNCMSG = 'O',
LoadedCapacityArray[X],
CNUORG = RatedCapacityArray[X].
// Calculate the cumulative resource available
If PastDuePeriods < X
Diff = RatedCapacityArray[X] - LoadedCapacityArray[X]
CummTotal = CummTotal + Diff
End
// Write capacity load F3313 records
CRCAPM = '1'
CRMCU = WorkCenter
CRUM = UnitOfMeasure
CRSTRT = BucketDateArray[X]
If PastDuePeriods >= X
If PastDuePeriods = 1
CRSTRT = 0
End
If PastDuePeriods = 2
If X = 1
CRSTRT = 1/1/1900 // Used for Past Due Date
1. Equal to Julian date value 1
Else
CRSTRT = 1/2/1900 // Used for Past Due Date
2. Equal to Julian date value 2
End
End
End
If UnitOfMeasure = 'HR'
If PrimeLoadCode = 'L' or 'B'
CRUNTY = '1'
End
If PrimeLoadCode = 'M' or 'C'
CRUNTY = '3'
End
Else
CRUNTY = '9'
End
Do CQT = 10 to 50 incrementing by 10
CRCQT = CQT
CRTRQT = 0
If CQT = 10 and PastDuePeriods < X
CRTRQT = RatedCapacityArray[X]
End
If CQT = 20
CRTRQT = LoadedCapacityArray[X]
End
If CQT = 30 and PastDuePeriods < X
CRTRQT = PCT
End
If CQT = 40 and PastDuePeriods < X
CRTRQT = Diff
End
If CQT = 50 and PastDuePeriods < X
CRTRQT = CummTotal
End
If CRTRQT <> 0 or CQT = 10
Write a new record to F3313 using the assigned
field values
End
End
End
End
End
D3300170 - RRP, Analyze Capacity Arrays
Data Item Data Structure DescriptionI/ORequiredNotes
MCU Work Center IY
UM Unit Of Measure IY
GENLNG Bucket Date Array Ptr IY From B3300140
GENLNG Rated Capacity Array Ptr IY From B3300150
GENLNG Loaded Capacity Array Ptr IY From B3300160
INT01 Past Due Periods IY
INT01 Number Of Periods IY
PILC Prime Load Code IY
PCT Over Capacity Percent IY
PCT Under Capacity Percent IY
SUPPS Suppress Error Message I '1' = Suppress runtime error
message
handling
' ' = Allow runtime error
message handling
DTAI Error Message ID O ' ' = Success
'3143' = Table access error
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szWorkCenter | MCU | char | NONE | NONE |
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit
| ||||
szUnitOfMeasure | UM | char | NONE | NONE |
A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box,
| ||||
idBucketDateArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
idRatedCapacityArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
idLoadedCapacityArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
iPastDuePeriods | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
iNumberOfPeriods | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
cPrimeLoadCode | PILC | char | NONE | NONE |
A code that determines if a work center is machine or labor intensive. The system also uses prime load codes in Resource Requirements
| ||||
mnOverCapacityPercent | PCT | MATH_NUMERIC | NONE | NONE |
An abbreviation for percentage. | ||||
mnUnderCapacityPercent | PCT | MATH_NUMERIC | NONE | NONE |
An abbreviation for percentage. | ||||
cSuppressErrorMessage | SUPPS | char | NONE | NONE |
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
0 = allow
| ||||
szErrorMessageID | DTAI | char | NONE | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
mnF3311UniqueID | UKID | MATH_NUMERIC | OPT | BOTH |
This field is a unique number used to identify a record in a file. | ||||
szCostCenterAlt | MMCU | char | OPT | NONE |
A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which
| ||||
szWorkcenterBranch | WMCU | char | OPT | NONE |
This is the branch/plant to which the work center belongs and must exist in the business unit master (F0006) and branch plant constants file
|
B9800100 Get Audit Information |
F3311 Capacity Message File | ||||
F3313 Capacity Load Table |