source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUSTAT2.m@ 1456

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

initial load of FOIAVistA 6/30/08 version

File size: 2.8 KB
Line 
1XUSTAT2 ;SF/RWF - User/CPU/device stats part3 ;2/27/91 16:19 ;
2 ;;8.0;KERNEL;;Jul 10, 1995
3A S (XUEQ,XULI,XUTTIME)="",$P(XUEQ,"=",80)=XUEQ,$P(XULI,"-",80)=XULI,XUPA=1,Y=XUST D DD^%DT S XUST=Y,Y=XUEN D DD^%DT S XUEN=Y,XUTUSER=0
4 S XUHDR=$S(XUSORT="V":"VOLUME SET",XUSORT="U":"USER",XUSORT="S":"SERVICE",1:"DEVICE")_"-REPORT"
5 D HDR2
6 I XUSORT="V" S XUCPU=0 F I=1:1 S XUCPU=$O(^TMP($J,"DUZ",XUCPU)) Q:XUCPU']"" D PROC Q:$D(DUOUT)
7 I XUSORT="U" S XUSER="" F I=0:0 S XUSER=$O(^TMP($J,0,XUSER)) Q:XUSER']"" S XUREC=^(XUSER) D USER Q:$D(DUOUT)
8 I XUSORT="S" S XUSER="" F XUI=0:0 S XUSER=$O(^TMP($J,"SER",XUSER)) Q:XUSER']"" D SERV Q:$D(DUOUT)
9 I XUSORT="D" S XU1="" F XUI=0:0 S XU1=$O(^TMP($J,"DEV",XU1)) Q:XU1']"" D DEVICE Q:$D(DUOUT)
10STATS W !!,"Total sign-on's processed: ",XUTREC
11 W !,"Total Taskman records: ",XUNOTM
12 W:XUSORT="U" !,"Total number of users: ",XUTUSER
13 W !,"Total number of sign-on's without a sign-off time: ",XUNODT,!
14EXIT G END^XUSTAT
15 Q
16PROC ;
17 I $Y+2>IOSL D HDR Q:$D(DUOUT)
18 S (XUON,XUSER)=0 F XUDUZ=0:0 S XUDUZ=$O(^TMP($J,"DUZ",XUCPU,XUDUZ)) Q:XUDUZ'>0 S X=^TMP($J,"DUZ",XUCPU,XUDUZ) S XUON=XUON+X,XUSER=XUSER+1
19 S X=$S($D(^TMP($J,"TIME",XUCPU,1)):^(1),1:0)
20 D SETTIME
21 W !,XUCPU,?15,XUON,?30,XUSER,?45,XUTIME,!,XULI
22 Q
23USER ;
24 I $Y+4>IOSL D HDR Q:$D(DUOUT)
25 S XU1=+XUREC,XU1T=0,XUTUSER=XUTUSER+1 W !,XUSER
26 S XU2="" F I=1:1 S XU2=$O(XUNAME(XU2)) Q:XU2']"" D TIME
27 S X=XU1T D SETTIME W !,?20,$E(XULI,1,11),!,?20,XUTIME
28 Q
29TIME S XUTIME="",X=$S($D(^TMP($J,"TIME",XU1,XU2))#2:^(XU2),1:0)
30 S XU1T=XU1T+X D:X SETTIME
31 W !,?5,XU2,?20,XUTIME,?35,$S($D(^TMP($J,"NODAT",XU1,XU2))#2:^(XU2),1:"")
32 Q
33DEVICE ;
34 I $Y+4>IOSL D HDR Q:$D(DUOUT)
35 S X=$S(XU1?1A.E:XU1,$D(^%ZIS(1,XU1,0)):$P(^(0),"^"),1:XU1) W !,X
36 S XU2="",XU1T=0 F I=1:1 S XU2=$O(XUNAME(XU2)) Q:XU2']"" D TIME
37 S X=XU1T D SETTIME W !,?20,$E(XULI,1,11),!,?20,XUTIME
38 Q
39SERV ;
40 I $Y+2>IOSL D HDR Q:$D(DUOUT)
41 S X=$S($D(^TMP($J,"TIME",XUSER,1)):^(1),1:0) D SETTIME
42 W !,XUSER,?37,XUTIME,?64,^TMP($J,"SER",XUSER),!,$E(XULI,1,$L(XUSER))
43 Q
44SETTIME ;
45 S XUTTIME=XUTTIME+X,%=X,XUTIME=$S(%\86400:%\86400_" ",1:" "),%=%#86400,XUTIME=XUTIME_$E(%\3600+100,2,3)_":"_$E(%\60#60+100,2,3)_":"_$E(%#60+100,2,3)
46 Q
47HDR I "C"[$E(IOST) S DIR(0)="E" D ^DIR Q:$D(DUOUT)
48HDR2 W @IOF,! S Y=DT X ^DD("DD") W Y,?25,XUHDR,?65,"Page # ",XUPA,!?20
49 W !?14,"This report was generated for the period",!?12,"beginning ",XUST," and ending ",XUEN
50 W:XUSORT="V" !!,"VOL",?15,"Number of",?30,"Number of",?45,"Connect Time",!?15,"Sign-on's",?30,"Users",?45,"Hrs:Min.Sec"
51 W:XUSORT="U" !!,"USER NAME",?20,"Connect time",?35,"No",!,?5,"VOL",?20,"Hrs:Min:Sec",?35,"sign-off"
52 W:XUSORT="S" !!,"Service",?40,"Total",?60,"Total",!?37,"Hrs:Min.Sec",?59,"Sign On's"
53 W:XUSORT="D" !!,"DEVICE NAME",?20,"Connect time",?35,"No",!,?5,"VOL",?20,"Hrs:Min:Sec",?35,"sign-off"
54 W !,XUEQ S XUPA=XUPA+1
55 Q
Note: See TracBrowser for help on using the repository browser.