source: FOIAVistA/tag/r/MAILMAN-XM/XMUT5Q.m@ 1717

Last change on this file since 1717 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1XMUT5Q ;(WASH ISC)/CAP-Delivery Queue Analysis ;04/17/2002 12:03
2 ;;8.0;MailMan;;Jun 28, 2002
3 Q
4QUIT ;End process
5 D REC
6QUIT1 K %,A,B,I,J,RSP,X,Y,ZTSK,ZTSAVE,ZTRTN,ZTDTH
7 K:'$D(ZTQUEUED) C,M,R
8 G ZTSK0
9 ;
10ZTSK ;SCHEDULE TO RUN
11 K XMUT5,XMUT5Q S ZTRTN="GO^XMUT5Q1" G GO
12ZTSK0 ;Reschedules itself here
13 S ZTRTN="GO2^XMUT5Q1"
14GO Q:$S($D(XMUT5NO):1,'$D(XMUT5F):0,'$D(XMUT5Q):0,XMUT5Q>XMUT5F:1,1:0)
15 S:'$D(XMUT5S) XMUT5S=1800
16 K XMUT5N S XMUT5Q=$G(XMUT5Q)+1,ZTSAVE("C*")="",ZTSAVE("XMZUT*")="",ZTREQ="@" I $D(ZTQUEUED) S XMUT5=1
17 S X=$H*86400+$P($H,",",2)+XMUT5S\XMUT5S*XMUT5S,ZTDTH=X\86400_","_(X#86400),ZTDESC="MGRMAIL "_XMUT5S_" second interval Delivery Queue Check"
18 S:'$D(ZTRTN) ZTRTN="GO^XMUT5Q1" S ZTIO="" D ^%ZTLOAD
19 Q
20REC ;RECORD QUEUE STATUS
21 D NOW^%DTC
22 ;
23 ;Look to see if data already file and quit if it is there
24 S X=$P(%,".")_"."_$E($P(%,".",2),1,2) I $E($P(%,".",2),3)>2 S X=X_3
25 S X=$O(^XMBX(4.2998,"B",X)),DA=$S(X="":"",1:$O(^(X,0))) Q:DA
26 I 'DA S X=%,DIC="^XMBX(4.2998,",DIC(0)="FI",Y=0 D FILE^DICN
27 S DIE="^XMBX(4.2998,",DA=+Y,XMUSER=$$USERS^XMUT5B(0)
28 ;zero node
29 S DR="1///"_(M("T")+R("T"))_";11///"_+M("T")_";12///"_+R("T")_";43///"_$P(^XMB(3.9,0),U,3)
30 I $G(XMUSER) S DR=DR_";39///"_XMUSER_";38///"_XMUSER
31 S %="LINES_READ" I $D(^XMBPOST(%)) L +^XMBPOST(%) S DR=DR_";15///"_^XMBPOST(%,0) S ^(0)=0 L -^XMBPOST(%)
32 ;File it
33 D ^DIE K DR
34 L +^XMBPOST("GSTATS","R")
35 S %=$G(^XMBPOST("STATS","R")) S:%>0 DR="45///"_+% S ^("R")=0
36 L -^XMBPOST("GSTATS","R")
37 L +^XMBPOST("GSTATS","M")
38 S %=$G(^XMBPOST("STATS","M")) S:%>0 DR=$S($D(DR):DR_";",1:"")_"44///"_+% S ^("M")=0
39 L -^XMBPOST("GSTATS","M")
40 S (%0,%)="" F I=1:1:10 S %0=$G(^XMBPOST("M",I)) S %=%+$P(%0,U,2)
41 S:%>0 DR=$S($D(DR):DR_";",1:"")_"46///"_%
42 S (%0,%)="" F I=1:1:10 S %0=$G(^XMBPOST("R",I)) S %=%+$P(%0,U,2)
43 S:%>0 DR=$S($D(DR):DR_";",1:"")_"47///"_% K %0
44 I $D(DR) D ^DIE K DR
45 ;1 node
46 S %=$P(M("T"),U,2) I % S DR=$S($D(DR):DR_";",1:"")_"101///"_($H*86400+$P($H,",",2)-%)
47 S %=$P(R("T"),U,2) I % S DR=$S($D(DR):DR_";",1:"")_"102///"_($H*86400+$P($H,",",2)-%)
48 S %=$S($D(^XMB(1,1,6)):^(6),1:"10^50,400"),DR=$S($D(DR):DR_";",1:"")_"103///"_$P(%,U,2)_";104///"_$P(%,U)
49 ;File it
50 I $D(DR) D ^DIE K DR
51 ;2 & 3 nodes
52 S I=201,DR="" D DR
53 D ^DIE:$L($G(DR)) K DR
54 ;4 & 5 nodes
55 S I=401,DR="" D DR
56 ;File it
57 D ^DIE:$L($G(DR)) K DR
58 ;Nodes 6 & 7 - Deliveries
59 F I=1:1:10 S %=$P(R("O",I),U,3) I % S DR=$S($D(DR):DR_";",1:"")_60_I_"///"_%
60 F I=1:1:10 S %=$P(M("O",I),U,3) I % S DR=$S($D(DR):DR_";",1:"")_70_I_"///"_%
61 D ^DIE:$L($G(DR))
62 K %H,D,D0,DI,DIE,DIC,DA,DO,DR,DQ,X
63 Q
64DR F I=I:1:I+9 S:$E(I)=2 %=R("O",I#100) S:$E(I)=4 %=M("O",I#100) I +% S:$L(DR) DR=$G(DR)_";" S DR=$G(DR)_(I+100)_"///"_+% I +$P(%,U,2) S DR=$G(DR)_";"_I_"///"_($H*86400+$P($H,",",2)-$P(%,U,2))
65 Q
66GET N J S J=I N I S I=J,Z=J
67GET1 W !!,"Please enter the following for "_$P("ORIGINAL MESSAGES: ,RESPONSES: ",",",Z)
68 R !!,"Enter up to 9 numbers separated by commas to determine statistical groupings.",!,"EG: 50,100,500 will create 4 groups: 1-49, 50-99, 100-499 & 500 and above.",!!,"Enter them now: ",X:DTIME
69 Q:"^"[X
70 F I=1:1 S A=$P(X,",",I) Q:A="" S B=$P(X,",",I+1) I $S(+A'=A:1,I>10:1,1:0)!(B'>A&B) D ERR G GET1
71 Q
72ENUSER ;Entry point called by VMS job that calculates active logons
73 ;Parameter passed has three comma (",") pieces for active logons
74 ;
75 ;**** REVISED 1/93 ****
76 ;VMS JOB NO LONGER WORKS -- ZSLOT USER ARE KEPT TRCK OF DIFFERENTLY
77 ;
78 ;$P(%,",",1)=Total - $P(%,",",2)=ZSLOT - $P(%,",",3)=Non-ZSLOT
79 ;$P(%,",",4)=VMS style date (N-MMM-YYY HH:MM:SS:xx)
80 ;
81 S U="^" L +^XMBX(4.2998)
82 S XMA0=%,%=$P(%,",",4),DA=$P($G(^XMBX(4.2998,0)),U,3) Q:'DA
83 ;
84 ;Re-construct VMS date to date FileMan's conversion can handle as input
85 F I=0:0 Q:$E(%)'=" " S %=$E(%,2,99)
86 S X=$P(%,"-",2)_" "_$E("0",$L(+%))_+%_", "_+$P(%,"-",3),XMB0=$P(%," ",2)
87 ;
88 ;If this data applies to the last entry made for statistics (within
89 ;1/2 hour) file it in this entry.
90 ;
91 D ^%DT S X=Y_"."_$P(XMB0,":")_$P(XMB0,":",2),(%0,Y)=^XMBX(4.2998,DA,0)
92 I X-Y<.003 F %=22,23 S X=$P(XMA0,",",%-20) I X>$P(Y,"^",%) S $P(Y,"^",%)=X,$P(Y,"^",21)=$P(Y,"^",21)+X
93 S ^XMBX(4.2998,DA,0)=Y L -^XMBX(4.2998) K DA,XMA0
94 Q
95ERR W $C(7)," ???" S X="" Q
96 ;
97NOTASK ;Run in foreground
98 S XMUT5NO=1,XMUT5=1
99 R !!,"Initialize time stamps in queue (necessary 1st run): NO// ",X:DTIME
100 K:$E(X)="Y" XMUT5
101 G 0^XMUT5Q1
Note: See TracBrowser for help on using the repository browser.