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

ZIBGCHAR.m

Go to the documentation of this file.
  1. ZIBGCHAR ; IHS/ADC/GTH - NONINTERACTIVE MODIFICATIONS OF GLOBAL CHARACTERISTICS ; [ 07/23/2002 10:35 AM ]
  1. ;;3.0;IHS/VA UTILITIES;**4,5,9**;FEB 07, 1997
  1. ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
  1. ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. ; XB*3*9 IHS/SET/GTH XB*3*9 07/23/2002 Cache' mods.
  1. ;
  1. ; Not all capabilities of the implementation-specific global
  1. ; characteristics routines are reflected in this routine.
  1. ;
  1. ; The argument for each entry point is the unsubscripted
  1. ; name of the global whose characteristics you want to
  1. ; change, with NO leading circumflex.
  1. ;
  1. ; If the call is successful, 0 is returned.
  1. ;
  1. ; If the call is not successful, a positive integer is
  1. ; returned, and the cause can be retrieved at the ERR()
  1. ; entry point.
  1. ;
  1. ; E.g's:
  1. ; S %=$$NOJOURN^ZIBGCHAR("AUTTSITE")
  1. ; I % W !,$$ERR^ZIBGCHAR(%)
  1. ;
  1. Q
  1. ;
  1. ;Begin New Code;IHS/SET/GTH XB*3*9 07/23/2002
  1. KILL(ZIBGLOB) ;PEP - Kill global or global referenced at the top level
  1. NEW QF,X
  1. I '$L($G(ZIBGLOB)) Q 1
  1. I ZIBGLOB'["," D Q QF ; just one global to kill
  1. . S QF=$$PROCESS("D","N")
  1. . I QF Q
  1. . KILL @("^"_ZIBGLOB)
  1. . I $$VERSION^%ZOSV(1)["Cache" S X=$ZU(68,28,1) ;disallow kill again
  1. .Q
  1. ;multiple globals to kill, comma delimited string like "gbl1,gbl2,gbl3"
  1. F X=1:1:$L(ZIBGLOB,",") S ZIBGLOB(X)=$P(ZIBGLOB,",",X)
  1. F X=1:1:$L(ZIBGLOB,",") D Q:QF
  1. . S QF=$$KILLOK(ZIBGLOB(X))
  1. . I QF Q
  1. . KILL @("^"_ZIBGLOB(X)),ZIBGLOB(X)
  1. .Q
  1. I $$VERSION^%ZOSV(1)["Cache" S X=$ZU(68,28,1) ;disallow kill again
  1. Q QF
  1. ;
  1. ;End New Code;IHS/SET/GTH XB*3*9 07/23/2002
  1. KILLOK(ZIBGLOB) ;PEP - Allow kill of global.
  1. Q $$PROCESS("D","N")
  1. ;
  1. KILLNO(ZIBGLOB) ;PEP - Prevent kill'ing of global.
  1. Q $$PROCESS("D","Y")
  1. ;
  1. JOURN(ZIBGLOB) ;PEP - Set Journaling to ALWAYS.
  1. Q $$PROCESS("J","A")
  1. ;
  1. NOJOURN(ZIBGLOB) ;PEP - Set Journaling for global to NEVER.
  1. Q $$PROCESS("J","N")
  1. ;
  1. UCIJOURN(ZIBGLOB) ;PEP - Journal when UCI is Journaled.
  1. Q $$PROCESS("J","U")
  1. ;
  1. PROCESS(ZIBFLAG,ZIBVAL) ;
  1. I '$L($G(ZIBGLOB)) Q 1
  1. ;I '(ZIBGLOB?1.8U) Q 5;IHS/SET/GTH XB*3*9 07/23/2002
  1. I '(ZIBGLOB?1.8U!(ZIBGLOB?1"%"1.7U)) Q 5 ;Cache needs to SET % globals;IHS/SET/GTH XB*3*9 07/23/2002
  1. I '$D(@("^"_ZIBGLOB)) Q 2
  1. ; NEW O ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
  1. ; S O=$P(^%ZOSF("OS"),"-",1) ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
  1. ; I '$L($T(@O)) Q 3 ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
  1. ; G @O ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
  1. ; I $P(^%ZOSF("OS"),"^",1)["MSM" G MSM ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err.
  1. I $$VERSION^%ZOSV(1)["Cache" Q $$CACHE(ZIBFLAG,ZIBGLOB,ZIBVAL) ;IHS/SET/GTH XB*3*9 07/23/2002
  1. I $P(^%ZOSF("OS"),"^",1)'["MSM" Q 3 ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. D MSM
  1. I '$D(ZTQUEUED) D HOME^%ZIS U IO(0) ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. Q 0 ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. ; Q 3 ; XB*3*4 IHS/ADC/GTH 05-22-97 Prevent <INDER> err. ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. ;
  1. ;Begin New Code;IHS/SET/GTH XB*3*9 07/23/2002
  1. CACHE(ZIBFLAG,ZIBGLOB,ZIBVAL) ;PEP - allow/prevent kill or enable/disable journaling on Cache
  1. ;TASSC/MFD added subroutine to mimic portions of %GCH that Cache can do
  1. ; -Patterned after CALL subroutine of MSM's %GCH but an extrinsic
  1. ; -Less options than MSM- journaling is either on or off for a global
  1. ; as there is no Journal entire UCI option
  1. ; -Allowing top-level kill is by process not by global specification
  1. ; -If the call is successful, 0 is returned.
  1. ;
  1. ; ZIBGLOB = global reference, no leading ^
  1. ; ZIBFLAG can be "J" or "D"- J is for journaling on or off, D is for
  1. ; allowing top kill or not
  1. ; ZIBVAL = for Journaling- E, A or U for enable, D, N or null for disable
  1. ; for Prev kill- Y to prevent kill, N to allow kill
  1. ;
  1. I '(ZIBGLOB?1.8U!(ZIBGLOB?1"%"1.7UL)) Q 5 ;TASSC/MFD added L to 1.7U for %zmu
  1. I '$D(@("^"_ZIBGLOB)) Q 2
  1. I ZIBFLAG="D",ZIBVAL="N" NEW X S X=$ZU(68,28,0) Q 0 ;don't prevent top-level kill for the process
  1. I ZIBFLAG="D",ZIBVAL="Y" NEW X S X=$ZU(68,28,1) Q 0 ;prevent top-level kill for the process
  1. I ZIBFLAG="J" NEW ZIBRC D
  1. .S ZIBVAL=$S(ZIBVAL="E":4,ZIBVAL="A":4,ZIBVAL="U":4,ZIBVAL="N":0,ZIBVAL="D":0,ZIBVAL="":0,1:1)
  1. .I ZIBVAL'=1 S ZIBRC=$$SetJournalType^%DM("",ZIBGLOB,ZIBVAL)
  1. .Q
  1. I ZIBRC=1 Q 0 ;Cache returns a 1 if successful
  1. Q 1 ; any other condition is bad so quit 1
  1. ;
  1. ;End New Code;IHS/SET/GTH XB*3*9 07/23/2002
  1. MSM ; Micronetics Standard MUMPS.
  1. I '$L($T(CALL^%GCH)) Q 4
  1. S:$D(ZTQUEUED) CALL="" ; Tell ^%GCH not to talk if errors.
  1. KILL O
  1. NEW (ZIBFLAG,ZIBGLOB,ZIBVAL) ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. D CALL^%GCH(ZIBFLAG,ZIBGLOB,ZIBVAL)
  1. KILL CALL
  1. ; Q 0 ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. Q ; XB*3*5 IHS/ADC/GTH 10-31-97 Prevent errors in return from ^%GCH.
  1. ;
  1. ERR(Z) ;PEP - Return cause of error.
  1. Q $P($T(@Z),";;",2)
  1. 1 ;;NO GLOBAL SPECIFIED IN PARAMETER
  1. 2 ;;GLOBAL DOES NOT EXIST
  1. 3 ;;OPERATING SYSTEM NOT SUPPORTED
  1. 4 ;;WRONG VERSION OF MSM'S ^%GCH
  1. 5 ;;BAD GLOBAL NAME
  1. ;
  1. ;
  1. TEST ;
  1. NEW AZHB,AZHB1
  1. F AZHBCTR=1:1 S AZHB=$P($T(DATA+AZHBCTR),";",3) Q:AZHB="###" D T1(AZHB),T2(AZHB)
  1. Q
  1. ;
  1. T1(AZHB) ;
  1. W !,"No Journaling For '",AZHB,"'"
  1. S AZHB1=$$NOJOURN(AZHB)
  1. W ?28," : ",AZHB1
  1. I AZHB1 W " : ",$$ERR(AZHB1)
  1. E W " : <kool>"
  1. Q
  1. ;
  1. T2(AZHB) ;
  1. W !,"No Killing For '",AZHB,"'"
  1. S AZHB1=$$KILLNO(AZHB)
  1. W ?28," : ",AZHB1
  1. I AZHB1 W " : ",$$ERR(AZHB1)
  1. E W " : <kool>"
  1. Q
  1. ;
  1. DATA ;
  1. ;;
  1. ;;FREDDATA
  1. ;;ACHSDATA
  1. ;;AUTTSITE
  1. ;;^AUTTLOC
  1. ;;jen
  1. ;;44
  1. ;;DIC(4,
  1. ;;###