ASU3ISQA ; IHS/ITSC/LMH -QUANTITY ADJUST TO STANDARD PACK ;
;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
;;This routine checks an index item in the station master for a
;;standard pack quantity. If one exists, the quantity requested on
;;an issue is adjusted to a multiple of standard pack quantity if
;;that quantity is within an acceptable upper and lower range of the
;;quantity requested.
SPQ(X,Y) ;EP; ADJUST TO STANDARD PACK QUANTITY
; X=QTY REQUESTED
; Y=QTY TO ISSUE
; Z=FORMULA VARIABLES AND CONSTANTS
N Z S Z("LOBG")=0,Z("LOND")=.11,Z("HIBG")=.89,Z("HIND")=1
START ;
S Y=X
Q:ASUMS("SPQ")'>0 Q:X=ASUMS("SPQ")
I X>ASUMS("SPQ") D
.S Z=X F S Z("ADJ")=Z-ASUMS("SPQ"),Z=Z("ADJ") Q:ASUMS("SPQ")>Z("ADJ")
E D
.S Z("ADJ")=X
S Z("DEC")=Z("ADJ")/ASUMS("SPQ")
I Z("DEC")'<Z("HIBG")&(Z("DEC")<Z("HIND")) D
.S Z("ADJ")=ASUMS("SPQ")-Z("ADJ"),Y=X+Z("ADJ")
E D
.I X<ASUMS("SPQ") Q
.I (Z("DEC")>Z("LOBG"))&(Z("DEC")<Z("LOND")) D
..S Y=X-Z("ADJ"),Z("ADJ")=Z("ADJ")*-1
Q
EOQ(X,Y) ;EP; SET RANGE FOR ECONOMIC ORDER QUANTITY
N Z S Z("LOBG")=0,Z("LOND")=.49999999999999999,Z("HIBG")=.5,Z("HIND")=1
G START
ASU3ISQA ; IHS/ITSC/LMH -QUANTITY ADJUST TO STANDARD PACK ;
+1 ;;4.2T2;Supply Accounting Mgmt. System;;JUN 30, 2000
+2 ;;This routine checks an index item in the station master for a
+3 ;;standard pack quantity. If one exists, the quantity requested on
+4 ;;an issue is adjusted to a multiple of standard pack quantity if
+5 ;;that quantity is within an acceptable upper and lower range of the
+6 ;;quantity requested.
SPQ(X,Y) ;EP; ADJUST TO STANDARD PACK QUANTITY
+1 ; X=QTY REQUESTED
+2 ; Y=QTY TO ISSUE
+3 ; Z=FORMULA VARIABLES AND CONSTANTS
+4 NEW Z
SET Z("LOBG")=0
SET Z("LOND")=.11
SET Z("HIBG")=.89
SET Z("HIND")=1
START ;
+1 SET Y=X
+2 IF ASUMS("SPQ")'>0
QUIT
IF X=ASUMS("SPQ")
QUIT
+3 IF X>ASUMS("SPQ")
Begin DoDot:1
+4 SET Z=X
FOR
SET Z("ADJ")=Z-ASUMS("SPQ")
SET Z=Z("ADJ")
IF ASUMS("SPQ")>Z("ADJ")
QUIT
End DoDot:1
+5 IF '$TEST
Begin DoDot:1
+6 SET Z("ADJ")=X
End DoDot:1
+7 SET Z("DEC")=Z("ADJ")/ASUMS("SPQ")
+8 IF Z("DEC")'<Z("HIBG")&(Z("DEC")<Z("HIND"))
Begin DoDot:1
+9 SET Z("ADJ")=ASUMS("SPQ")-Z("ADJ")
SET Y=X+Z("ADJ")
End DoDot:1
+10 IF '$TEST
Begin DoDot:1
+11 IF X<ASUMS("SPQ")
QUIT
+12 IF (Z("DEC")>Z("LOBG"))&(Z("DEC")<Z("LOND"))
Begin DoDot:2
+13 SET Y=X-Z("ADJ")
SET Z("ADJ")=Z("ADJ")*-1
End DoDot:2
End DoDot:1
+14 QUIT
EOQ(X,Y) ;EP; SET RANGE FOR ECONOMIC ORDER QUANTITY
+1 NEW Z
SET Z("LOBG")=0
SET Z("LOND")=.49999999999999999
SET Z("HIBG")=.5
SET Z("HIND")=1
+2 GOTO START