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

SCCVDEL1.m

Go to the documentation of this file.
  1. SCCVDEL1 ;ALB/TMP - OLD SCHED VISITS FILE DELETE; [ 03/04/98 09:39 AM ]
  1. ;;5.3;Scheduling;**211,1015**;Aug 13, 1993;Build 21
  1. ;
  1. DELDATA ; -- kill global
  1. N VALMY,SCCV
  1. D FULL^VALM1
  1. W !
  1. ;
  1. ; -- check for gaps
  1. IF '$$GAP^SCCVDEL() G DELDATAQ
  1. ;
  1. ; -- check for complete flag
  1. IF '$$COMPL^SCCVDEL() G DELDATAQ
  1. ;
  1. D EN^VALM2($G(XQORNOD(0)))
  1. S SCCV=0 F S SCCV=$O(VALMY(SCCV)) Q:'SCCV D
  1. . D KILL(+$G(^TMP("SCCV.DELETE.DX",$J,SCCV)))
  1. D BLD^SCCVDEL
  1. ;
  1. DELDATAQ ;
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. KILL(FNO) ; -- kill data global
  1. N SCGLB
  1. ;
  1. IF '$G(FNO) W !!,"Invalid file number '",$G(FNO),"' specified." G KILLQ
  1. ;
  1. IF FNO'=40.1,FNO'=40.15,FNO'=409.5,FNO'=409.43,FNO'=409.44 W !!,"Invalid file number '",$G(FNO),"' specified." G KILLQ
  1. ;
  1. S SCGLB=$$FGLB^SCCVDEL(FNO)
  1. IF $D(^DIC(FNO)) W !!,"Data global '",SCGLB,"' cannot be KILLed. ^DIC(",FNO,") still exists." G KILLQ
  1. ;
  1. IF $D(^DD(FNO)) W !!,"Data global '",SCGLB,"' cannot be KILLed. ^DD(",FNO,") still exists." G KILLQ
  1. ;
  1. IF $D(@SCGLB)=0 W !!,"Data global '",SCGLB,"' does not exist. Global does not need to be KILLed." G KILLQ
  1. ;
  1. IF $D(@SCGLB) D
  1. . IF $$PROT(SCGLB) D
  1. . . S Y=$$LOG^SCCVDEL(FNO,$G(DUZ),"DATA")
  1. . . IF 'Y D Q
  1. . . . W !!,"Cannot kill data global!"
  1. . . . W !,$P(Y,U,2)
  1. . . S X="ERR^SCCVDEL1",@^%ZOSF("TRAP")
  1. . . K @SCGLB
  1. . . W !!,"Data global '",SCGLB,"' successfully KILLed."
  1. . ELSE D
  1. . . W !!,"Data gloabl '",SCGLB,"' was not KILLed."
  1. ;
  1. KILLQ D PAUSE^SCCVU
  1. Q
  1. ;
  1. PROT(SDGLB) ; -- ask if ok to kill and protection is off
  1. N DIR,Y
  1. W !
  1. S DIR(0)="YA"
  1. S DIR("A")="Are you sure you want to KILL the '"_SDGLB_"' global? "
  1. S DIR("B")="No"
  1. D ^DIR
  1. IF 'Y S SCOK=0 G PROTQ
  1. ;
  1. IF SDGLB="^SDD(409.43)"!(SCGLB="^SDD(409.44)") S SCOK=1 G PROTQ
  1. ;
  1. W !
  1. S DIR(0)="YA"
  1. S DIR("A")="Are you sure global root KILL protection is turned off? "
  1. S DIR("B")="No"
  1. D ^DIR
  1. IF 'Y S SCOK=0 G PROTQ
  1. S SCOK=1
  1. PROTQ Q SCOK
  1. ;
  1. ERR ; -- error trap routine
  1. ;
  1. ; -- check for 'protection' error and set $ECODE to null
  1. ; -- setting of $ECODE to null per Wally Fort instructions on 1/28/99
  1. IF $$EC^%ZOSV["PROT" D S $ECODE="" Q
  1. . W !!,">>> Protection error has occurred. Global has not been KILLed."
  1. . W !," You must removed root-level protection on global."
  1. D @^%ZOSF("ERRTN")
  1. Q