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/_ZTMOVE.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: 4.4 KB
Line 
1%ZTMOVE ;SF/STAFF - Easier Multi-CPU routine transfers ;12/27/94 09:26
2 ;;8.0;KERNEL;;Jul 10, 1995
3 S:'$D(DTIME) DTIME=120
4OUT S U="^",MGR=$P(^%ZOSF("MGR"),",",1) X ^%ZOSF("UCI") S:Y'["," Y=Y_","_^%ZOSF("VOL") S HOME=Y,HOME("MGR")=MGR
5 W !!,"This will move the complete text of the routines selected to",!,"the MGR account of the system being moved to."
6 W !,"If you send a large number of routines you may run out of disk space",!,"on the target system.",!!
7 W !,"From ",HOME," send what routines!" K ^UTILITY($J) X ^%ZOSF("RSEL") G EXIT:$O(^UTILITY($J,0))=""
8 W !!,"You're in ",HOME
9 K ZTSYS F ZTI=1:1 D WHERE G EXIT:$D(DUOUT) Q:X="" W !!,"Then..."
10 W !!,"Starting to send!"
11 F ZTI=1:1 Q:'$D(ZTSYS(ZTI)) S X=ZTSYS(ZTI),ZTMODE=$P(X,U,1),SYS=$P(X,U,2),UCI=$P(X,U,3) D SEND
12 W !!,"Summary" F ZTI=1:1 Q:'$D(ZTSYS(ZTI,1)) S X=ZTSYS(ZTI),Y=ZTSYS(ZTI,1) D
13 . W !?3,"To ",$P(X,U,2)," ",$S('Y:Y,$E(X)="M":"as task # "_Y,1:"in UCI: "_$P(X,U,3))
14 . Q
15EXIT K ZTSK,ZTSYS,ZTI,ZTMODE,SYS,UCI,HOME,ANS,DEF,MGR,Y,X,DUOUT,^UTILITY($J)
16 Q
17 ;
18WHERE W !,"To which Volume Set (2-7 letters or * for all) to send routines? " R SYS:DTIME G ALL:ZTI=1&(SYS="*"),ESC:'$T!(SYS["^"),WHEX:SYS'?2.7U
19 I $P(HOME,",",2)=SYS W !,*7,"THIS IS THE SAME SYSTEM!!"
20 R !,"Auto-load or Manual: Manual//",X:DTIME S ZTMODE=$E(X_"M") G ESC:'$T!(X["^"),WHERE:"AM"'[ZTMODE
21 S UCI=MGR I ZTMODE="A" R !,"Enter UCI to unload into: ",UCI:DTIME G ESC:'$T!(UCI["^"),WHERE:UCI'?2.7U
22 S ZTSYS(ZTI)=ZTMODE_U_SYS_U_UCI,X=1 Q
23WHEX S X="" Q
24ESC S X="",DUOUT=1 Q
25ALL ;
26 R !,"Auto-load or Manual: Manual//",X:DTIME S ZTMODE=$E(X_"M") G ESC:'$T!(X["^"),ALL:"AM"'[ZTMODE
27 S HOME(1)=$P(HOME,","),HOME(2)=$P(HOME,",",2),SYS="",UCI=""
28 F ZTI=1:1 S SYS=$O(^%ZIS(14.6,"AT",HOME(1),HOME(2),SYS)) Q:SYS="" I SYS'=HOME(2) S UCI=$O(^(SYS,"")) I UCI]"" S ZTSYS(ZTI)=ZTMODE_U_SYS_U_UCI
29 S X="" Q
30SEND S MGR=HOME("MGR"),SYSM=SYS,X=$$LINK^%ZTM5(SYS) S:X]"" MGR=$P(X,","),SYSM=$P(X,",",2),ZTSYS(ZTI,2)=X
31 G SENDLOC:$P(HOME,",",2)=SYS ;ELSE SENDREM
32SENDREM S X="ERR",@^%ZOSF("TRAP"),X="^[MGR,SYSM]%ZTSK"
33 W !!,">>ROUTINES WILL NOW BE SENT TO "_SYS_" MACHINE" D NODE W " AS TASK # ",ZTSK," <<",!
34 W:$D(ZTSYS(ZTI,2)) " accessed by uci,volume: ",ZTSYS(ZTI,2),!
35 I ZTMODE="M" W !,"REMEMBER YOU MUST LOAD THE ROUTINES IN MANUALLY AT THE OTHER CPU",!,"WITH 'D IN^%ZTMOVE'"
36 W !! S R=0
37 X "F I=1:1 S R=$O(^UTILITY($J,R)) Q:R'?1AP.ANP ZL @R W $J(R,10) S ^[MGR,SYSM]%ZTSK(ZTSK,I,0)=R F J=1:1 S T=$T(+J) Q:T="""" S ^(J)=T"
38 S ^[MGR,SYSM]%ZTSK(ZTSK,0,"ZTMOVE")=" routine"_$S(I-1'=1:"s",1:"")_" transfered from "_HOME,^[MGR,SYSM]%ZTSK(ZTSK,1)=I-1,ZTSYS(ZTI,1)=ZTSK
39 I ZTMODE="A" L ^[MGR,SYSM]%ZTSCH S ^[MGR,SYSM]%ZTSCH($$H3^%ZTM($H),ZTSK)="" W " Scheduled"
40 L Q
41SENDLOC S X="ERR",@^%ZOSF("TRAP"),X="^%ZTSK" D NODE
42 W !!,">>ROUTINES WILL NOW BE SENT TO THIS MACHINE AS TASK # ",ZTSK," <<",!
43 I ZTMODE="M" W !,"REMEMBER YOU MUST LOAD THE ROUTINES IN MANUALLY ",!,"WITH 'D IN^%ZTMOVE'"
44 W !! S R=0
45 X "F I=1:1 S R=$O(^UTILITY($J,R)) Q:R'?1AP.ANP ZL @R W $J(R,10) S ^%ZTSK(ZTSK,I,0)=R F J=1:1 S T=$T(+J) Q:T="""" S ^(J)=T"
46 S ^%ZTSK(ZTSK,0,"ZTMOVE")=" routine"_$S(I-1'=1:"s",1:"")_" transfered from "_HOME,^%ZTSK(ZTSK,1)=I-1,ZTSYS(ZTI,1)=ZTSK
47 I ZTMODE="A" L ^%ZTSCH S ^%ZTSCH($H,ZTSK)="" L W " Scheduled"
48 L Q
49 ;
50NODE N %
51 S ZNODE=$S(ZTMODE="M":"EXIT^%ZTMOVE",1:"AUTO^%ZTMOVE")_U_$G(DUZ)_U_UCI_U_$H_U_($H+2)_",1",$P(ZNODE,U,14)=SYS
52 L +@X@(-1) S ZTSK=@X@(-1)+1 F ZTSK=ZTSK:1 Q:$D(@X@(ZTSK))=0
53 S @X@(ZTSK,0)=ZNODE,@X@(ZTSK,.1)=$S(ZTMODE="M":"K",1:1)
54 L +@X@(ZTSK),-@X@(-1)
55 S @X@(ZTSK,.03)="ZTMOVE of routines to "_SYS
56 Q
57 ;
58ERR W !,"CANNOT SEND TO '"_SYS_"'!",! S ZTSYS(ZTI,1)="Error exit" Q
59 ;
60IN ;
61 S:$D(DTIME)[0 DTIME=30
62 R !,"Task Number: ",ZTSK:DTIME G EXIT:'$T!(ZTSK="")!(ZTSK="^")
63 I ZTSK'?1N.N W !,"Enter a number between ",$O(^%ZTSK(.1))," and ",^%ZTSK(-1),"!" G IN
64 S DEL=0 R !,"Delete Task After Loading? ",YN:DTIME Q:'$T!(YN="^")
65 S DEL=(YN["Y")
66 I '$D(^%ZTSK(ZTSK)) W !!?3,*7,"No such task number exists.",! G IN
67 I '$D(^%ZTSK(ZTSK,0,"ZTMOVE")) W !!?3,*7,"Not a 'ZTMOVE' task!" G IN
68 X ^%ZOSF("UCI") S:Y'["," Y=Y_","_^%ZOSF("VOL") S N=^%ZTSK(ZTSK,1) W !!,N,^(0,"ZTMOVE"),!,"READY TO BE LOADED INTO '",Y
69 R "' ...OK? YES// ",X:DTIME G EXIT:"Yy"'[$E(X_"Y")
70 W ! S ZTL="W "" "",R F I=1:1 Q:'$D(^(I)) ZI ^(I)"
71 X "F J=1:1:N ZR S R=^%ZTSK(ZTSK,J,0) X ZTL ZS @R" K:DEL ^%ZTSK(ZTSK)
72 G EXIT
73 ;
74AUTO ;AUTO-LOAD
75 I '$D(^%ZTSK(ZTSK,0,"ZTMOVE")) G EXIT
76 S ZTL="F I1=1:1 Q:'$D(^(I1)) ZI ^(I1)"
77 F I=.9:0 S I=$O(^%ZTSK(ZTSK,I)) Q:I'>0 S R=^%ZTSK(ZTSK,I,0) X "ZR X ZTL ZS @R"
78 S ZTREQ="@" G EXIT
Note: See TracBrowser for help on using the repository browser.