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

XUTMQ2.m

Go to the documentation of this file.
  1. XUTMQ2 ;SEA/RDS - TaskMan: Option, XUTMINQ, Part 4 (Modules) ;6/21/95 16:25 [ 04/02/2003 8:29 AM ]
  1. ;;8.0;KERNEL;**1002,1003,1004,1005,1007**;APR 1, 2003
  1. ;;8.0;KERNEL;;Jul 10, 1995
  1. ;
  1. ENTRY G ^XUTMQ
  1. ;
  1. PRINT ;Subroutine--Print A Task
  1. N XUTMT,ZTSK W:'ZTC @IOF,!,ZTH,! W:'ZTF !,"-------------------------------------------------------------------------------"
  1. S X=0,ZTC=0,ZTF=0 D EN^XUTMTP(ZTS) I $Y>18 W ! S ZTF=1,DIR(0)="E" D ^DIR S X=$D(DTOUT)!$D(DUOUT) Q:X W @IOF
  1. S ZTC=ZTC+1 Q
  1. ;
  1. OUT ;Tag for breaking FOR scope to exit early
  1. Q
  1. ;
  1. N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZTC,ZTF,ZTH,ZTS S ZTC=0,ZTF=1,ZTH="Tasks waiting for dropped links..."
  1. S ZT1="" F ZT=0:0 S ZT1=$O(^%ZTSCH("LINK",ZT1)),ZT2="" Q:ZT1="" F ZT=0:0 S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)) Q:'ZT2 F ZTS=0:0 S ZTS=$O(^%ZTSCH("LINK",ZT1,ZT2,ZTS)) Q:'ZTS D PRINT G OUT:X
  1. I 'ZTC W !!,"There are no tasks on this volume set that are waiting for dropped links."
  1. W ! S DIR(0)="E",DIR("A")=$S(ZTC:"End of listing. ",1:"")_"Press RETURN to continue" D ^DIR Q
  1. ;
  1. RUN ;Running tasks.
  1. N XUTMT,ZTSK,ZT1
  1. I ^%ZOSF("OS")["VAX DSM" F ZT1=0:0 D VAX1 Q:ZT1'>0
  1. S XUTMT(0)="R4"
  1. S XUTMT("CLEAR")=1
  1. S XUTMT("EOL")=1
  1. S XUTMT("HEADER")="Running tasks..."
  1. S XUTMT("NODE")="^%ZTSCH(""TASK"","
  1. S XUTMT("NONE")="There are no tasks listed as running."
  1. D ^XUTMT Q
  1. ;
  1. VAX1 ;Use VMS to help clean the TASK list
  1. N $ETRAP,PID S $ETRAP="K ^%ZTSCH(""TASK"",ZT1) S $ECODE="""""
  1. VAX2 S ZT1=$O(^%ZTSCH("TASK",ZT1)) Q:ZT1'>0
  1. S PID=$P((^%ZTSCH("TASK",ZT1)),U,10) Q:'PID
  1. S Y=$&ZLIB.%GETJPI(PID,"PID")
  1. Q
  1. ;
  1. FUT ;Future tasks.
  1. N DIR,DIRUT,DTOUT,DUOUT,X,ZT,ZT1,ZT2,ZT3,ZTC,ZTF,ZTH,ZTS
  1. K ^TMP($J)
  1. S ZTC=0,ZTF=1,ZTH="Scheduled and waiting tasks..."
  1. W !!,"Building sorted list of tasks..."
  1. ;
  1. F1 S ZT1="" F S ZT1=$O(^%ZTSCH("JOB",ZT1)) Q:ZT1="" D
  1. .S ZT2="" F S ZT2=$O(^%ZTSCH("JOB",ZT1,ZT2)) Q:'ZT2 D
  1. .. D SORT(ZT1,ZT2) ;S ^TMP($J,99999-ZT1,99999-$P(ZT1,",",2),ZT2)=""
  1. .Q
  1. ;
  1. F2 S ZT1=$$H3^%ZTM($H) F S ZT1=$O(^%ZTSCH(ZT1)) Q:'ZT1 D
  1. .S ZTS=0 F S ZTS=$O(^%ZTSCH(ZT1,ZTS)) Q:'ZTS D
  1. .. D SORT(ZT1,ZTS) ;S ^TMP($J,99999-ZT1,99999-$P(ZT1,",",2),ZTS)=""
  1. .Q
  1. ;
  1. F3 S ZT1="" F S ZT1=$O(^%ZTSCH("IO",ZT1)) Q:ZT1="" D
  1. .S ZT2="" F S ZT2=$O(^%ZTSCH("IO",ZT1,ZT2)) Q:'ZT2 D
  1. ..S ZT3=0 F S ZT3=$O(^%ZTSCH("IO",ZT1,ZT2,ZT3)) Q:ZT3="" D
  1. ... D SORT(ZT2,ZT3) ;S ^TMP($J,99999-ZT2,99999-$P(ZT2,",",2),ZT3)=""
  1. .Q
  1. ;
  1. F4 S ZT1="" F S ZT1=$O(^%ZTSCH("LINK",ZT1)) Q:'ZT1 D
  1. .S ZT2="" F S ZT2=$O(^%ZTSCH("LINK",ZT1,ZT2)) Q:'ZT2 D
  1. ..S ZTS=0 F S ZTS=$O(^%ZTSCH("LINK",ZT1,ZT2,ZTS)) Q:'ZTS D
  1. ... D SORT(ZT2,ZTS) ;S ^TMP($J,99999-ZT2,99999-$P(ZT2,",",2),ZTS)=""
  1. .Q
  1. W "finished!"
  1. ;
  1. F5 ;
  1. G:$O(^TMP($J,0))="" F6
  1. S ZTSAVE("^TMP($J,")="" D EN^XUTMDEVQ("LIST^XUTMQ","TASK LIST",.ZTSAVE)
  1. K ^TMP($J)
  1. Q
  1. S ZT1="" F S ZT1=$O(^TMP($J,ZT1),-1) Q:ZT1="" D I X Q
  1. . S ZTS=0 F S ZTS=$O(^TMP($J,ZT1,ZTS)) Q:'ZTS D PRINT I X Q
  1. .Q
  1. I X K ^TMP($J) Q
  1. ;
  1. F6 I 'ZTC W !!,"There are no future tasks on this volume set."
  1. W ! S DIR(0)="E",DIR("A")="Press RETURN to continue" D
  1. .I ZTC S DIR("A")="End of listing. "_DIR("A")
  1. D ^DIR K ^TMP($J) Q
  1. ;
  1. SORT(ZTDTH,ZTSK) ;
  1. I ZTDTH["," S ZTDTH=$$H3^%ZTM(ZTDTH)
  1. S ^TMP($J,ZTDTH,ZTSK)=""
  1. Q