Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XUTMG19

XUTMG19.m

Go to the documentation of this file.
  1. XUTMG19 ;SF/RWF - TaskMan Code For File 19.2 ;06/09/99 09:32
  1. ;;8.0;KERNEL;**20,67,118**;Jul 10, 1995
  1. ;
  1. Q
  1. FIND ;subroutine--find scheduled task that will run this option
  1. ;Return XUTASK = task number, XUDTH = H3 time
  1. N %,OPT,X,X1,Y X ^%ZOSF("UCI") S XUTASK=0,Y=$P(Y,","),OPT=$$GET(19,$$GET(19.2,DA,.01),.01)
  1. S X=+$S($D(ZTMQDT):ZTMQDT,$D(^DIC(19.2,DA,0)):$$GET(19.2,DA,2),1:0) Q:'X
  1. S XUDTH=$$H3^%ZTM($$FMTH^XLFDT(X))
  1. S %=$$GET(19.2,DA,12) I %>0 D CHECK Q:XUTASK
  1. F S %=$O(^%ZTSCH(XUDTH,%)) Q:%'>0 I $P($G(^%ZTSK(%,0)),"^",1,2)="ZTSK^XQ1" D CHECK Q:XUTASK
  1. Q
  1. CHECK ;Check a task
  1. S X1=$G(^%ZTSK(%,0)) Q:$P(X1,"^",1,2)'="ZTSK^XQ1" Q:$P(X1,"^",11)'=Y
  1. I $G(^%ZTSK(%,.03))'[OPT Q ;Check for name in desc.
  1. S:$G(^%ZTSK(%,.3,"XQSCH"))=DA XUTASK=%
  1. Q
  1. ;
  1. GET(FN,IEN,FE) ;
  1. N A,B,C
  1. S A=$G(^DD(FN,FE,0)),A=$P(A,"^",4)
  1. S B=$P(A,";"),C=$P(A,";",2)
  1. Q $P($G(^DIC(FN,IEN,B)),"^",C)
  1. ;--------------------------------------------------------------------
  1. IT2 ;input transform for time (#2)
  1. N Y,% S %DT="ETRXF" D ^%DT S X=Y,%=$$NOW^XLFDT() I %+.0002>X K X
  1. I '$D(X),'$D(DDS) D CT^XUTMG19
  1. Q
  1. ;
  1. CT ;IT2--show current time %=NOW
  1. W !,?5,"The current time is ",$E(%,9,10),":",$E(%,11,12)
  1. Q
  1. ;
  1. S2 ;set logic for AZTM cross-reference on time (#2)
  1. N DV,ZTSK,ZTIO,ZTDTH,ZTDESC,ZTRTN,ZTCPU,X1
  1. S ZTDTH=X I 'ZTDTH G EXIT
  1. S ZTCPU=$$GET(19.2,DA,5) I ZTCPU']"" K ZTCPU
  1. S ZTRTN="ZTSK^XQ1"
  1. S ZTSAVE("XQSCH")=DA,X1=+^DIC(19.2,DA,0),ZTSAVE("XQY")=X1
  1. S ZTDESC=$P(^DIC(19,X1,0),U)_" - "_$P(^DIC(19,X1,0),U,2)
  1. S ZTIO=$$GET(19.2,DA,3)
  1. D ^%ZTLOAD S ^DIC(19.2,DA,1)=ZTSK
  1. EXIT Q
  1. ;
  1. K2 ;kill logic for AZTM cross-reference on time (#2)
  1. N XUTASK,XUDTH,XUTMT S ZTMQDT=X D FIND K ZTMQDT I XUTASK'>0 Q
  1. Q:XUTASK=$G(ZTQUEUED)
  1. S XUTMT=XUTASK,^DIC(19.2,DA,1)="" D ^XUTMTD
  1. Q
  1. ;
  1. ;--------------------------------------------------------------------
  1. ;
  1. IT3 ;input transform for device (#3)
  1. N DIC,Y,XUTMG19
  1. I X[""""!($A(X)=45)!($L(X)>70) K X Q
  1. S DIC="^%ZIS(1,",DIC(0)="E",XUTMG19=X,X=$P(X,";") D ^DIC
  1. I Y=-1 K X Q
  1. S $P(XUTMG19,";")=$P(Y,U,2),IOP=XUTMG19,%ZIS="NQR" D ^%ZIS
  1. I POP K X
  1. E S X=ION_";"_$S($D(IO("DOC"))#2:IO("DOC"),1:IOST_";"_IOM_";"_IOSL)
  1. D RESETVAR^%ZIS
  1. Q
  1. ;
  1. S3 ;set logic for AZTIO cross-reference of device (#3)
  1. N XUTASK,XUDTH D FIND I XUTASK'>0 Q
  1. S $P(^%ZTSK(XUTASK,.2),U)=X
  1. Q
  1. ;
  1. K3 ;kill logic for AZTIO cross-reference of device (#3)
  1. N XUTASK,XUDTH D FIND I XUTASK'>0 Q
  1. S $P(^%ZTSK(XUTASK,.2),U)=""
  1. Q
  1. ;
  1. ;--------------------------------------------------------------------
  1. ;
  1. IT6 ;input transform for re-sch freq
  1. I $L(X)>15!($L(X)<2) K X Q
  1. I X?1.3N1"H" Q
  1. I X?1.4N1"S" Q
  1. I X?1.3N1"D" Q
  1. I X?1.2N1"M" Q
  1. I X?1.2N1"M(".E1")" Q
  1. I "MTWRFSUDE"[$E(X),"@,"[$E(X,2) Q
  1. K X
  1. Q
  1. ;
  1. ;-------------------------------------------------------------------
  1. ;
  1. IT5 ;input transform for volume (#5)
  1. N X1,X2 S X1=$P(X,":"),X2=$P(X,":",2)
  1. I X[""""!($A(X)=45) K X Q
  1. I $L(X)>21!($L(X)<2) K X Q
  1. I '((X?1.8UN)!(X?1.8UN.1":".12UN)) K X Q
  1. I X'[":",'$D(^%ZIS(14.5,"B",X)) K X Q
  1. I X[":",'$D(^%ZIS(14.7,"B",X)) K X Q
  1. Q
  1. ;
  1. S5 ;set logic for AZTVOL cross-reference of volume
  1. N XUCPU,XUTASK,XUDTH D FIND I XUTASK>0 D
  1. . S $P(^%ZTSK(XUTASK,0),U,14)=X
  1. N X S X=$$GET(19.2,DA,9) D S9 ;Trigger the startup X-ref
  1. Q
  1. ;
  1. K5 ;kill logic for AZTVOL cross-reference on volume
  1. N XUCPU,XUTASK,XUDTH D FIND I XUTASK>0 D
  1. . S $P(^%ZTSK(XUTASK,0),U,14)=""
  1. D K9X(X) ;Trigger the startup X-ref
  1. Q
  1. ;
  1. ;--------------------------------------------------------------------
  1. ;
  1. IT9 ;input transform for special queueing (#9)
  1. N Y S Y=$P(^DIC(19,+^DIC(19.2,DA,0),0),U,4)
  1. I Y="A"!(Y="R") Q
  1. K X W $C(7)," ONLY FOR 'ROUTINE' OR 'ACTION' TYPES OF OPTIONS"
  1. Q
  1. ;
  1. S9 ;set logic for ASTARTUP cross-reference on special queueing
  1. Q:X'["S" ;Only for startup type
  1. N Y,Y1,XUCPU,XIO S XUCPU=$$GET(19.2,DA,5),Y1=$$GET(19.2,DA,.01)
  1. X ^%ZOSF("UCI") I XUCPU]"" S $P(Y,",",2)=XUCPU
  1. S ^%ZTSCH("STARTUP",Y,DA_"Q"_Y1)=$H_U_$$GET(19.2,DA,3)_U
  1. Q
  1. ;
  1. K9 ;kill logic for ASTARTUP cross-reference on special queueing
  1. N Y,Y1,XUCPU S XUCPU=$$GET(19.2,DA,5),Y1=$$GET(19.2,DA,.01)
  1. K9A X ^%ZOSF("UCI") I XUCPU]"" S $P(Y,",",2)=XUCPU
  1. K ^%ZTSCH("STARTUP",Y,Y1),^%ZTSCH("STARTUP",Y,DA_"Q"_Y1)
  1. Q
  1. ;
  1. K9X(XUCPU,Y1) ;Kill logic called from other X-ref
  1. N Y S:'$D(XUCPU) XUCPU=$$GET(19.2,DA,5) S:'$D(Y1) Y1=$$GET(19.2,DA,.01)
  1. G K9A
  1. ;
  1. XREF ;Reindex the STARTUP nodes
  1. N DIK,DA,X
  1. F DA=0:0 S DA=$O(^DIC(19.2,DA)) Q:DA'>0 S DIK="^DIC(19.2," D IX^DIK
  1. Q