XUTMSYNC ;ISCSF/RWF - SYNC TASK MANAGMENT ;07/13/94  15:57
 ;;8.0;KERNEL;**163**;Jul 10, 1995
A ;Lookup and clear/restart a sync queue.
 ;N DIC,DIR,XUFLAG,XUIO,XUDA,X,Y
 S DIC="^%ZISL(14.8,",DIC(0)="AEMQ" D ^DIC G:Y'>0 EXIT
 S XUDA=+Y,XUIO=$P($P(Y,"^",2),"~"),XUFLAG=$P($P(Y,"^",2),"~",2)
 ;QUICK HACK TO SHOW DATA
 W !,^%ZISL(14.8,XUDA,0),!,$G(^(1))
 S DIR(0)="S^Z:ZAP;S:START NEXT;Q:QUIT"
 S DIR("A")="What to do with this one:" D ^DIR G:Y="Q" A
 G A:Y="Q",ZAP:Y="Z",START:Y="S",EXIT
START ;START, CLEAR AND START NEXT
 N IOT S IOT="RES"
 S X=$$SYNCFLG^%ZTMS2("D",XUIO,XUFLAG)
 D SCHSYNC^%ZTMS2(XUFLAG,XUIO)
 W !,"OK"
 Q
ZAP ;CLEAR SYNC FLAG AND DELETE QUEUE.
 N IOT S IOT="RES"
 K ^%ZTSCH("SYNC",XUFLAG,XUIO)
 S X=$$SYNCFLG^%ZTMS2("D",XUIO,XUFLAG)
 W !,"ZAPPED"
 Q
EXIT Q
