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/XUGOT1.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 9.4 KB
Line 
1XUGOT1 ; BT/OAK-BP - COMPARE LOCAL/NATIONAL CHECKSUMS REPORT ;10/20/2006
2 ;;8.0;KERNEL;**369**;Jul 10, 1995;Build 27
3 Q
4REPORT ;
5 W !!,">>> This processing will take about thirty minutes."
6 W !," It will save your time if you send this report"
7 W !," to a printer.",!
8 S %ZIS="Q" D ^%ZIS I POP D ^%ZISC,END Q
9 ; Queue report via Taskman
10 I $D(IO("Q")) D G END
11 . N ZTDESC,ZTSK,ZTRTN,ZTIO,ZTSAVE
12 . S ZTRTN="ENT^XUGOT1",ZTDESC="Compare local/national checksums report"
13 . D ^%ZTLOAD,^%ZISC
14 . W !,"Task ",$S($G(ZTSK):ZTSK,1:"NOT")," Queued"
15 . K IO("Q")
16ENT ;
17 K ^TMP($J)
18 N CKRTP F CKRTP=1:1:9 S CKRTP(CKRTP)=0
19 N SLX,SL S U="^",SLX="ZL @RTN S SL=$T(@RTN+1)"
20 ;Use SUMB in XPDRSUM
21 N XUIEN S XUIEN=0 F S XUIEN=$O(^DIC(9.8,XUIEN)) Q:XUIEN'>0 D
22 . N RTN,X S (RTN,X)=$P($G(^DIC(9.8,XUIEN,0)),U) I $L(RTN)=0 Q
23 . I $P($G(^DIC(9.8,XUIEN,0)),U,2)'="R" Q
24 . S CKRTP(1)=CKRTP(1)+1 ;Total count of routines reviewed (#1)
25 . N TRACK S TRACK=$$TRACK(XUIEN) I TRACK'>0 S CKRTP(3)=CKRTP(3)+1 Q ; routine isn't being tracked (#3)
26 . I $L(RTN)>8 S ^TMP($J,8,RTN)="",CKRTP(8)=CKRTP(8)+1 Q
27 . N NSUM,NLPATCH S NSUM=$$NSUM(XUIEN),NLPATCH=$$NLPATCH(XUIEN)
28 . I NSUM="",TRACK'=1 Q ; check for national checksum is empty, and not Local Track
29 . I TRACK>2 Q ; Quit if routine is marked as "National - Deleted or NOT tracked"
30 . X ^%ZOSF("TEST") I '$T S CKRTP(2)=CKRTP(2)+1,^TMP($J,2,RTN)=NSUM_"^"_NLPATCH Q ;routine is not found on the system (#2)
31 . X SLX ; get the second line
32 . I SL="" S SL=$$GETSL^XUGOT(X)
33 . N LSUM S LSUM=$$LSUM(RTN) I $E(LSUM,2,10)'>0 S CKRTP(2)=CKRTP(2)+1,^TMP($J,2,RTN)=NSUM_"^"_NLPATCH Q ;routine is not found on the system (#2)
34 . I NSUM=LSUM S CKRTP(4)=CKRTP(4)+1 Q ;national and local checksums match (#4)
35 . I TRACK=1 S ^TMP($J,5,RTN)=NSUM_"^"_LSUM,CKRTP(5)=CKRTP(5)+1 Q ; Local tracked (#5)
36 . ;--------- national and local checksums don't match
37 . N XUN1,XUN2,XUN3,XUN4,XUL1,XUL2,XUL3,XUA,XUP,XULM,XUPN S XULM="Yes",XUPN="No"
38 . S XUP=$$PACK^XUGOT(RTN,SL) ;Patch and version AAA*Z.Z*
39 . N NPL2 S NPL2=$$NPL2^XUGOT(XUIEN) I +$P(SL,";",3)=$P(NPL2,"*",2) S $P(XUP,"*",2)=$P(NPL2,"*",2)
40 . S XUL2=$$LPLIST(SL)
41 . S XUL2=$$LPATCH(XUL2) ;Last patch number from the second line
42 . S XUL3=XUP_XUL2 ;Latest local patch base on second line
43 . S XUN1=$$NPL1(XUIEN,LSUM,XUL2) ;Number national patch list and patch that matches LSUM.
44 . S XUN3=$$NLPATCH(XUIEN) ;Last patch name from Patch multiple fields
45 . S XUN2=$P(XUN3,"*",3) ;Last patch number from the last patch name
46 . S XUN4=$$XUN4^XUGOT(XUN3) ;Last Version from the last patch name
47 . I $P(XUN1,"^",3)'="" S XULM="Unknown"
48 . I $P(XUN1,"^",2)'="" S XULM="No"
49 . I XUL2'="",XUL2'=XUN2,$$LPLIST(SL)[XUN2 S XUPN="Testing "_XUP_XUL2,XULM="Unknown"
50 . I XUL2'="" S XUA=$P($P(XUN1,"^"),XUL2_",",2) I XUA'="" S XUPN=XUP_XUA I $P(NPL2,"*")'="",$P(NPL2,"*",2)'="" S XUPN=NPL2_"*"_XUA ; Missing patches
51 . I +XUL2'="",XUL2=XUN2 S ^TMP($J,6,RTN)=NSUM_"^"_LSUM_"^"_XUL3_"^Yes^No",CKRTP(6)=CKRTP(6)+1 Q
52 . I XUL2'="",XUL2'=+XUL2 S ^TMP($J,6,RTN)=NSUM_"^"_LSUM_"^"_XUL3_"^Yes^Unknown",CKRTP(6)=CKRTP(6)+1 Q
53 . I XUL2'="",XUL2'=XUN2,$$LPLIST(SL)'[XUN2,$P(XUN1,"^")'[XUL2 S ^TMP($J,6,RTN)=NSUM_"^"_LSUM_"^"_XUL3_"^Unknown^"_XUN3,CKRTP(6)=CKRTP(6)+1 Q
54 . I XUL2="" S XULM="Unknown"
55 . I XUL2="",XUN2="" S XUPN=XUN3
56 . I XUL2="",XUN2'="" S XUPN=XUP_$P(XUN1,"^")
57 . N XUNV,XULV S XULV=+$P(SL,";",3),XUNV=$$RT^XUGOT(RTN)
58 . I XUN4'>0 S XUN4=+$P(XUNV,"^",3)
59 . I $P(XUNV,"^")="",$$SL^XUGOT(SL)="" S ^TMP($J,9,RTN)="",CKRTP(9)=CKRTP(9)+1 Q
60 . N XUK S XUK=0
61 . I $P(XUNV,"^")="" D
62 . . N XUL3A S XUL3A=$$SL^XUGOT(SL)_"*"_XULV_"*",XULM="Unknown",XUPN="Unknown"
63 . . I $$SL^XUGOT(SL)="" S XUL3A=$P(XUN3,"*",1,2)_"*"
64 . . I XUL3A="*" S XUL3A=NPL2_"*"
65 . . S XUL3=XUL3A_XUL2
66 . . I XUL2'="",XUL2'=XUN2,$$LPLIST(SL)[XUN2 S XUPN="Testing "_XUL3,XULM="Unknown"
67 . . I XUL2'="" S XUA=$P($P(XUN1,"^"),XUL2_",",2) I XUA'="" S XUPN=XUP_XUA I $P(NPL2,"*")'="",$P(NPL2,"*",2)'="" S XUPN=NPL2_"*"_XUA ; Missing patches
68 . . S ^TMP($J,6,RTN)=NSUM_"^"_LSUM_"^"_XUL3_"^"_XULM_"^"_XUPN,CKRTP(6)=CKRTP(6)+1,XUK=1
69 . I XUK=1 Q
70 . ; version off
71 . N XUK S XUK=0
72 . I XULV>0,XULV'=XUN4 D
73 . . N XUL3A S XUL3A=$$SL^XUGOT(SL)_"*"_XULV_"*",XULM="Unknown",XUPN="Unknown"
74 . . I $$SL^XUGOT(SL)="" S XUL3A=$P(XUN3,"*",1,2)_"*"
75 . . I XUL3A="*" S XUL3A=NPL2_"*"
76 . . S XUL3=XUL3A_XUL2
77 . . I XUL2'="",XUL2'=XUN2,$$LPLIST(SL)[XUN2 S XUPN="Testing "_XUL3,XULM="Unknown"
78 . . I XUL2'="" S XUA=$P($P(XUN1,"^"),XUL2_",",2) I XUA'="" S XUPN=XUP_XUA I $P(NPL2,"*")'="",$P(NPL2,"*",2)'="" S XUPN=NPL2_"*"_XUA ; Missing patches
79 . . S ^TMP($J,6,RTN)=NSUM_"^"_LSUM_"^"_XUL3_"^"_XULM_"^"_XUPN,CKRTP(6)=CKRTP(6)+1,XUK=1
80 . I XUK=1 Q
81 . S ^TMP($J,6,RTN)=NSUM_"^"_LSUM_"^"_XUL3_"^"_XULM_"^"_XUPN,CKRTP(6)=CKRTP(6)+1 Q
82 D PRT
83 Q
84 ;
85PRT N ST,Y4 S ST=0,Y4=1
86 N IOC,IOC1 S IOC=(IO=IO(0)),IOC1=$E(IOST,1,2)["C-"
87 U IO W:IOC1 @IOF
88 W !,$$PG(Y4)
89 N HDR1,HDR2,RPTYP
90 F RPTYP=5,6,7,2,9,8,3,4,1 Q:ST D
91 . I RPTYP=1 W !,"ROUTINE FILE TOTAL ENTRIES COUNT (",CKRTP(1),")",!
92 . I RPTYP=2,CKRTP(2)>0 W !,"ROUTINES NOT FOUND IN THE SYSTEM (",CKRTP(2),")" D CN W ! D CN I CKRTP(2) D HEADER
93 . I RPTYP=3,CKRTP(3)>0 W !,"ROUTINES NOT MARKED FOR TRACKING (",CKRTP(3),")",!
94 . I RPTYP=4,CKRTP(4)>0 W !,"ROUTINES WITH MATCHING CHECKSUMS (",CKRTP(4),")",!
95 . I RPTYP=5,CKRTP(5)>0 W "ROUTINES MARKED FOR LOCAL TRACKING (",CKRTP(5),")",! I CKRTP(5) D HEADER
96 . I RPTYP=6,CKRTP(6)>0 W !,"ROUTINES WITH THE CHECKSUM OFF(",CKRTP(6),")" D CN W ! D CN I CKRTP(6) D HEADER
97 . ;I RPTYP=7,CKRTP(7)>0 W !,"ROUTINES WITH VERSION OFF(",CKRTP(7),")" D CN W ! D CN I CKRTP(7) D HEADER
98 . I RPTYP=8,CKRTP(8)>0 W !,"ROUTINES WITH MORE THAN 8 CHARACTERS NAME(",CKRTP(8),")" D CN W ! D CN I CKRTP(8) D HEADER
99 . ;I RPTYP=9,CKRTP(9)>0 W !,"ROUTINES WITH NO PACKAGE ASSOCIATED WITH(",CKRTP(9),")" D CN W ! D CN I CKRTP(9) D HEADER
100 . ;
101 . S RTN="" F S RTN=$O(^TMP($J,RPTYP,RTN)) Q:(RTN="")!(ST) D
102 . . D CN I ST Q
103 . . N Y3 S Y3=$G(^TMP($J,RPTYP,RTN))
104 . . I RPTYP=5 W " ",RTN,?11,$P(Y3,"^",1),?23,$P(Y3,"^",2),!
105 . . I RPTYP=6 W " ",RTN,?11,$P(Y3,"^",1),?23,$P(Y3,"^",2),?35,$E($P(Y3,"^",3),1,11),?48,$P(Y3,"^",4),?57,$E($P(Y3,"^",5),1,23),!
106 . . I RPTYP=7 W " ",RTN,?11,$P(Y3,"^",1),?24,$P(Y3,"^",2),?37,$P(Y3,"^",3),!
107 . . I RPTYP=2 W " ",RTN,?11,$P(Y3,"^",1),?23,$P(Y3,"^",2),!
108 . . I RPTYP=8 W " ",RTN,!
109 . . ;I RPTYP=9 W " ",RTN,!
110 . . Q
111 . Q
112 ;--------------------------
113END D ^%ZISC K ^TMP($J),%DT,%ZIS
114 Q
115 ;--------------------------
116PG(XUN) ;
117 W #,$$FMTE^XLFDT(DT),?(IOM\2),"Page: ",XUN,!!
118 Q ""
119 ;--------------------------
120HEADER ;
121 S HDR1=" Routine Nat CHKSUM ",HDR2=" ======= ========== "
122 I RPTYP=2 S HDR1=HDR1_"Nat Last Patch",HDR2=HDR2_"============="
123 I RPTYP=6 S HDR1=HDR1_"Our CHKSUM Our Patch Loc Mod Patches Needed",HDR2=HDR2_"========== =========== ======= =============="
124 I RPTYP=5 S HDR1=" Routine CHKSUM Base Our CHKSUM",HDR2=HDR2_"==========="
125 I RPTYP=7 S HDR1=" Routine Nat Version Loc Version Latest Nat Patch",HDR2=" ======= =========== =========== =============="
126 I RPTYP=8 S HDR1=" Routine ",HDR2=" ======="
127 ;I RPTYP=9 S HDR1=" Routine",HDR2=" ======="
128 W HDR1,!
129 W HDR2,!
130 Q
131 ;---------------------------
132%Z1 R "Enter RETURN to continue or '^' to exit: ",ST:60 S ST=$S(ST["^":1,1:0) S:'$T ST=1 W @IOF
133 Q
134 ;---------------------------
135CN I (($Y+2)=IOSL)!(($Y+3)=IOSL) S Y4=Y4+1 D:IOC&IOC1 %Z1 Q:ST W $$PG(Y4) D HEADER
136 Q
137 ;--------------------------------------------------------------------------
138LSUM(RTN) ;Get the new Checksum LOCAL
139 I $G(RTN)="" Q ""
140 N DIF,RTNL,X,XCNP,Y
141 S X=RTN,DIF="RTNL(",XCNP=0 X ^%ZOSF("LOAD")
142 S Y=$$SUMB^XPDRSUM($NA(RTNL))
143 Q "B"_Y
144 ;
145NSUM(IEN) ; get national checksum
146 I +$G(IEN)'>0 Q ""
147 N XUI,XUSUM
148 S XUI=$G(^DIC(9.8,IEN,4)),XUSUM=$P(XUI,U,2)
149 I XUSUM["/" S XUSUM=$P(XUSUM,"/",2)
150 I XUSUM'="",XUSUM'["B" S XUSUM="B"_XUSUM ;get checksum from field #7.2
151 Q XUSUM
152 ;------------------------------
153NPLIST(IEN) ; get list patches from the field #7.3
154 I +$G(IEN)'>0 Q ""
155 N XUPLIST
156 S XUPLIST=$P($G(^DIC(9.8,+IEN,4)),"^",3)
157 S XUPLIST=$P(XUPLIST,"**",2)
158 Q $$TRIM^XLFSTR(XUPLIST)
159 ;
160NPL(IEN) ; get list patches from Patch multiple
161 I '$D(^DIC(9.8,IEN,8,0)) Q ""
162 N XUIEN,XUPC,XULP,XUFLP S (XULP,XUPC,XUFLP)="",XUIEN=0
163 F S XUIEN=$O(^DIC(9.8,IEN,8,XUIEN)) Q:XUIEN'>0 D
164 . I XULP'="" S XUPC=XUPC_","
165 . S XUFLP=$P($G(^DIC(9.8,IEN,8,XUIEN,0)),"^"),XULP=$P(XUFLP,"*",3)
166 . S XUPC=XUPC_XULP
167 Q XUPC
168 ;
169NPL1(IEN,SUM,LPN) ; get list patches from Patch multiple
170 I '$D(^DIC(9.8,IEN,8,0)) Q ""
171 N XUIEN,XUPC,XULP,XUFLP,XUA,XUB,XUC S (XULP,XUPC,XUFLP)="",(XUB,XUIEN,XUC)=0
172 F S XUIEN=$O(^DIC(9.8,IEN,8,XUIEN)) Q:XUIEN'>0 D
173 . I XULP'="" S XUPC=XUPC_","
174 . S XUA=$G(^DIC(9.8,IEN,8,XUIEN,0)),XUFLP=$P(XUA,"^"),XULP=$P(XUFLP,"*",3)
175 . I XULP=LPN S XUC="" I SUM'=$P(XUA,"^",2) S XUB=""
176 . S XUPC=XUPC_XULP
177 Q XUPC_"^"_XUB_"^"_XUC
178 ;
179LPLIST(SL) ; get list of patch Number from the second line
180 I $G(SL)="" Q ""
181 N XUPLIST
182 S XUPLIST=$P(SL,"**",2) ;XUPLIST=$P(XUPLIST,"**",2)
183 S XUPLIST=$$TRIM^XLFSTR(XUPLIST)
184 Q XUPLIST
185 ;
186LPATCH(PLIST) ; get the last patch number of the patch list from the second line
187 I $G(PLIST)="" Q ""
188 N XUI,PLIST1
189 S PLIST1=$TR(PLIST,","),XUI=$L(PLIST)-$L(PLIST1)
190 Q $P(PLIST,",",XUI+1)
191 ;
192NLPATCH(IEN) ;get national last patch name
193 I +$G(IEN)'>0 Q ""
194 N XUA
195 S XUA=$O(^DIC(9.8,IEN,8,"A"),-1) I XUA'>0 Q ""
196 S XUA=$G(^DIC(9.8,IEN,8,XUA,0)),XUA=$P(XUA,"^")
197 Q XUA
198 ;--------------------------------
199TRACK(IEN) ; get national information
200 N XUA
201 S XUA=$P($G(^DIC(9.8,IEN,6)),"^")
202 I (XUA="")!(XUA="Local - don't report") S XUA=0
203 I XUA="Local - report" S XUA=1
204 I XUA="National - report" S XUA=2
205 Q XUA
206 ;
Note: See TracBrowser for help on using the repository browser.