source: WorldVistAEHR/trunk/r/CAPACITY_MANAGEMENT_RUM-KMPR/KMPRBD01.m@ 949

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1KMPRBD01 ;OAK/RAK - RUM Daily/Weekly Compression ;11/19/04 10:31
2 ;;2.0;CAPACITY MANAGEMENT - RUM;**1**;May 28, 2003
3 ;
4EN ;-- entry point for Background Driver.
5 ;
6 S:'$G(DT) DT=$$DT^XLFDT
7 ;
8 N ENDT,STR
9 ;
10 S STR=$$NOW^XLFDT
11 D DAILY^KMPRBD02(+$H)
12 ; store start, stop and delta times for daily background job
13 D STRSTP^KMPDUTL2(2,1,1,STR)
14 ;
15 ; clean up old "job" nodes.
16 D CLEAN
17 ;
18 ; if sunday do weekly compression
19 I '$$DOW^XLFDT(DT,1) D
20 .; store weekly start/stop stats.
21 .S STR=$$NOW^XLFDT
22 .D WEEKLY^KMPRBD04(DT)
23 .; store start, stop and delta times for weekly background job
24 .D STRSTP^KMPDUTL2(2,2,1,STR)
25 ;
26 ; check for errors.
27 D ERRORS
28 ;
29 Q
30 ;
31CLEAN ;-- clean up old "JOB" nodes
32 ;
33 N JOB,NODE S NODE=""
34 F S NODE=$O(^KMPTMP("KMPR","JOB",NODE)) Q:NODE="" D
35 .S JOB=0 F S JOB=$O(^XTMP("KMPR","JOB",NODE,JOB)) Q:'+JOB D
36 ..I '$D(^XUTL("XQ",JOB)) K ^KMPTMP("KMPR","JOB",NODE,JOB)
37 ;
38 ; Store the number of active user jobs into ^XTMP("KMPR","ACTIVE")
39 ; D CLUSTER^%ZKMPRC1
40 ;
41 Q
42 ;
43ERRORS ; check and process errors.
44 ;
45 Q:'$D(^XTMP("KMPR","ERR"))
46 ;
47 N H,I,LN,N,O,SITE,TEXT,XMSUB,X,XMTEXT,XMY,XMZ,Y,Z
48 ;
49 S SITE=$$SITE^VASITE
50 S XMSUB="RUM Error at site "_$P(SITE,U,3)_" on "_$$FMTE^XLFDT($$DT^XLFDT)
51 S TEXT(1)=" The following error(s) have been logged at "_$P(SITE,U,2)_" ("_$P(SITE,U,3)_") "
52 S TEXT(2)=" while moving data from ^XTMP(""KMPR"",""DLY"") to file 8971.1."
53 S H="",LN=3
54 ; H = date in $H format (+$H).
55 ; N = node name.
56 ; O = option.
57 F S H=$O(^XTMP("KMPR","ERR",H)) Q:H="" S N="" D
58 .F S N=$O(^XTMP("KMPR","ERR",H,N)) Q:N="" S O="" D
59 ..F S O=$O(^XTMP("KMPR","ERR",H,N,O)) Q:O="" D
60 ...S TEXT(LN)="",LN=LN+1
61 ...S TEXT(LN)="Date..: "_H_" Node: "_N,LN=LN+1
62 ...S TEXT(LN)="Option: "_O,LN=LN+1
63 ...; prime time.
64 ...S TEXT(LN)="Prime Time = "_$G(^XTMP("KMPR","ERR",H,N,O,0)),LN=LN+1
65 ...; non-prime time.
66 ...S TEXT(LN)="Non-Prime Time = "_$G(^XTMP("KMPR","ERR",H,N,O,1)),LN=LN+1
67 ...; message.
68 ...F I=0:0 S I=$O(^XTMP("KMPR","ERR",H,N,O,"MSG",I)) Q:'I D
69 ....S TEXT(LN)=^XTMP("KMPR","ERR",H,N,O,"MSG",I),LN=LN+1
70 S XMTEXT="TEXT("
71 S XMY("G.KMP2-RUM@ISC-ALBANY.VA.GOV")=""
72 D ^XMD
73 ;
74 K ^KMPTMP("KMPR","ERR")
75 ;
76 Q
Note: See TracBrowser for help on using the repository browser.