Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AMQQRMM

AMQQRMM.m

Go to the documentation of this file.
AMQQRMM ; IHS/CMI/THL - MONTH CATEGORIES ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
 I AMQQCCLS="V" G:$D(AMQP(1)) START Q
 I '$D(AMQQHOLD)!('$D(AMQQUATN)) Q
 S %=$P($G(^UTILITY("AMQQ",$J,"AG",AMQQUATN,AMQQHOLD)),U,3)
 I '% Q
 S AMQP(1)=%
START I '$D(AMQQMZ) S (AMQQMZ,AMQQMX)=0
 S AMQQMZ=AMQQMZ+1
 I IOST["C-",AMQQMZ>1 W $C(13),AMQQMZ I AMQQMX W "  (",AMQQMX,")"
 I AMQQMZ>1 D SET Q
 I IOST["C-" W !!!!,"CRUNCH, CRUNCH....",!!
 D PRE
 D SET
EXIT K %,%H,%T,%Y,A,G,I,J,M,N,Z
 Q
 ;
FAIL S AMQQMX=AMQQMX+1
 I AMQQMZ>1 W $C(13),AMQQMZ,"  (",AMQQMX,")"
 Q
 ;
RANGE S AMQQMDS=AMQQMDS\1
 S AMQQMDF=AMQQMDF\1
 S (Z(1),Y)=AMQQMDS\1
 X ^DD("DD")
 S AMQQMDS=Y
 S (Z(2),Y)=AMQQMDF\1
 X ^DD("DD")
 S AMQQMDF=Y
 S AMQQMDS=$P(AMQQMDS," ")_" "_$P(AMQQMDS,",",2)
 S AMQQMDF=$P(AMQQMDF," ")_" "_$P(AMQQMDF,",",2)
 S Y(1)=+$E(Z(1),1,3)
 S Y(2)=+$E(Z(2),1,3)
 S M(1)=+$E(Z(1),4,5)
 S M(2)=+$E(Z(2),4,5)
 S %=1+(M(2)-M(1))+((Y(2)-Y(1))*12)
 S X=%\12
 S Y=%#12
 F I=1:1:12 S $P(AMQQMCS,U,I)=X
 F I=M(1):1:(M(1)+Y-1) S Z=$P("1^2^3^4^5^6^7^8^9^10^11^12^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*100
 S X=%
 S Y=%+59
 S I=0
 I %<1000 S X="0"_X,Y="0"_Y
 I X="00" S X="0000",Y="0059"
 W !,X,"-",Y
 F J=16:8 W ?J,$S($D(@AMQQMGR@("A",AMQQMLIN,I)):^(I),1:".") S I=I+1 I I=7 W ?(J+8),@AMQQMGR@("B",AMQQMLIN) Q
 Q
 ;
PAUSE I IOST["C-" R !,"<>",AMQQRQ:DTIME S:'$T!(AMQQRQ=U) AMQQMLIN=999999 K AMQQRQ
 I AMQQMLIN=999999 Q
 D HEADER
 Q
 ;
 W !,"MONTH CATEGORY REPORT: ",AMQQMDS," to ",AMQQMDF,!!
 W "MONTH",?9,"TOTAL",?16,"MONTH",?27,"AVG",!?16,"COUNT",?24,"PER MONTH"
 S AMQQMY="",$P(AMQQMY,"-",35)="" W !,AMQQMY
 K AMQQRI,AMQQRJ,AMQQMY
 Q
 ;
MONTASK S ZTRTN="MONRUN^AMQQRMM"
 S ZTIO=ION
 S ZTDTH="NOW"
 F I=1:1 S %=$P("AMQQRMFL;AMQV(;AMQQ200(;AMQQRV;AMQQNV;AMQQXV;^UTILITY(""AMQQ"",$J,;^UTILITY(""AMQQ RAND"",$J,;^UTILITY(""AMQQ TAX"",$J,",";",I) Q:%=""  S ZTSAVE(%)=""
 S ZTDESC="Q-MAN MONTHLY WORKLOADLOAD REPORT"
 D ^%ZTLOAD
 D ^%ZISC
 W !!,$S($D(ZTSK):"Request queued!",1:"Request cancelled!"),!!!
 H 3
 Q
 ;
MON ; ENTRY POINT FROM AMQQCMPL
 D DEV
 I $D(AMQQQUIT) Q
 S AMQQRMFL="^AMQQRMM"
 I $D(IO("Q")) D MONTASK D ^%ZISC W @IOF Q
 U IO D MONRUN D ^%ZISC
 Q
 ;
DEV W !!!
 S %ZIS="Q"
 D ^%ZIS
 I POP K DUOUT,DTOUT,POP S AMQQQUIT=""
 D PRINT^AMQQSEC E  W "  <= Not a secure device!!",*7 G DEV
 I $D(IO("Q")),IO=IO(0) W !!,"You can not queue a job to a slave printer..Try again",!!,*7 G DEV
 Q
 ;
MONRUN W @IOF
 X AMQV(0)
 D PRINT
 I IOST["P-" W @IOF
 I $D(ZTQUEUED) D EXIT2^AMQQKILL S ZTREQ="@"
 Q
 ;