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

LEXRXC.m

Go to the documentation of this file.
LEXRXC ;ISL/KER - Re-Index 757.01 B/ADC/ADTERM ;04/21/2014
 ;;2.0;LEXICON UTILITY;**81,80**;Sep 23, 1996;Build 10
 ;               
 ; Global Variables
 ;    ^LEX(               SACC 1.3
 ;    ^LEX(757.01)        SACC 1.3
 ;    ^TMP("LEXRX")       SACC 2.3.2.5.1
 ;               
 ; External References
 ;    $$FMDIFF^XLFDT      ICR  10103
 ;    $$NOW^XLFDT         ICR  10103
 ;    $$UP^XLFSTR         ICR  10104
 ;    FILE^DID            ICR   2052
 ;    IX1^DIK             ICR  10013
 ;               
 ; Local Variables NEWed or KILLed Elsewhere
 ;     LEXNAM     Task name       NEWed/KILLed by LEXRXXT
 ;     LEXSET     Re-Index flag   NEWed/KILLed by LEXRXXT
 ;     LEXTEST    Test variable   NEWed/KILLed by Developer
 ;     LEXQ       Quiet flat      NEWed/KILLed by LEXRXXT2
 ;     ZTQUEUED   Task flag       NEWed/KILLed by Taskman
 ;     
 Q
 ; NOTES:
 ;               
 ;   The Major Concept Map file #757 is used to re-index
 ;   the Expression file #757.01. hence file #757 must be 
 ;   repaired/re-indexed before file 757.01.
 ;                 
EN ; Main Entry Point
R75701 ; Repair file 757.01
 D MC,RB,RADC,RADTERM,R75701^LEXRXC2,R75701^LEXRXC3,SET Q
RB ;   Index    ^LEX(757.01,"B",TXT,IEN) 
 ;            ^LEX(757.01,IEN,4,"B",NEG,IEN2)
 ;            ^LEX(757.01,IEN,5,"B",WORD,IEN2)
 W:'$D(ZTQUEUED) ! N DA,DIK,LEXBEG,LEXDIF,LEXELP,LEXEND,LEXERR,LEXEXP,LEXFI,LEXIDX,LEXIDXT,LEXIDNT,LEXIDST,LEXIEN,LEXMC,LEXNDS,LEXNDSN,LEXNDSS,LEXNER,LEXOK,LEXS,LEXSER,LEXSTR
 S LEXFI="757.01"
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,"Repairing File #757.01 ""B""") Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT,(LEXNDS,LEXNDSN,LEXNDSS,LEXERR,LEXSER,LEXNER)=0,LEXSTR="",LEXFI="757.01",LEXIDX="B"
 S LEXIDXT="^LEX(757.01,""B"",TXT,IEN)",LEXIDNT="^LEX(757.01,IEN,4,""B"",NEG,IEN2)",LEXIDST="^LEX(757.01,IEN,5,""B"",WORD,IEN2)"
 F  S LEXSTR=$O(^LEX(LEXFI,LEXIDX,LEXSTR)) Q:'$L(LEXSTR)  D
 . N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN)) Q:+LEXIEN'>0  D
 . . S LEXNDS=LEXNDS+1 I '$D(^LEX(LEXFI,LEXIEN,0)) D  Q
 . . . S LEXERR=LEXERR+1 K:'$D(LEXTEST) ^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN)
 . . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,LEXSTR,?58,"  ",LEXIEN
 . . N LEXOK,LEXEXP S LEXEXP=$$UP^XLFSTR($G(^LEX(LEXFI,LEXIEN,0)))
 . . S LEXOK=0 S:$E(LEXEXP,1,63)=LEXSTR LEXOK=1 I 'LEXOK D
 . . . S LEXERR=LEXERR+1
 . . . K:'$D(LEXTEST) ^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN) S:$L(LEXEXP) ^LEX(LEXFI,LEXIDX,$E(LEXEXP,1,63),LEXIEN)=""
 . . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,$E(LEXSTR,1,26),?58,"  ",LEXIEN
 . . I $D(^LEX(LEXFI,LEXIEN,4)) D
 . . . N LEXSTR S LEXSTR="" F  S LEXSTR=$O(^LEX(LEXFI,LEXIEN,4,LEXIDX,LEXSTR)) Q:'$L(LEXSTR)  D
 . . . . N LEXS S LEXS=0 F  S LEXS=$O(^LEX(LEXFI,LEXIEN,4,LEXIDX,LEXSTR,LEXS)) Q:+LEXS'>0  D
 . . . . . S LEXNDSN=LEXNDSN+1 N LEXOK,LEXMC S LEXMC=$G(^LEX(LEXFI,LEXIEN,4,LEXS,0))
 . . . . . S LEXOK=0 S:LEXMC=LEXSTR LEXOK=1 I 'LEXOK D
 . . . . . . S LEXNER=LEXNER+1 K:'$D(LEXTEST) ^LEX(LEXFI,LEXIEN,4,LEXIDX,LEXSTR,LEXS)
 . . . . . . S:$L(LEXMC) ^LEX(LEXFI,LEXIEN,4,LEXIDX,LEXMC,LEXS)=""
 . . . . . . I '$D(ZTQUEUED) W !,?10,757.17,?19,LEXIDX,?30,$E(LEXSTR,1,26),?58,"  ",LEXIEN,"/",LEXS
 . . . S LEXSTR=0 F  S LEXSTR=$O(^LEX(LEXFI,LEXIEN,4,LEXSTR)) Q:+LEXSTR'>0  D
 . . . . N DA,X S X=$P($G(^LEX(LEXFI,LEXIEN,4,LEXSTR,0)),"^",1),DA(1)=LEXIEN,DA=LEXSTR
 . . . . I $L(X) I '$D(^LEX(LEXFI,DA(1),4,LEXIDX,X,DA)) D  Q
 . . . . . S LEXNER=LEXNER+1,^LEX(LEXFI,DA(1),4,LEXIDX,X,DA)=""
 . . . . . I '$D(ZTQUEUED) W !,?10,757.17,?19,LEXIDX,?30,"Missing",?58,"  ",DA(1),"/",DA
 . . I $D(^LEX(LEXFI,LEXIEN,5)) D
 . . . N LEXSTR S LEXSTR="" F  S LEXSTR=$O(^LEX(LEXFI,LEXIEN,5,LEXIDX,LEXSTR)) Q:'$L(LEXSTR)  D
 . . . . N LEXS S LEXS=0 F  S LEXS=$O(^LEX(LEXFI,LEXIEN,5,LEXIDX,LEXSTR,LEXS)) Q:+LEXS'>0  D
 . . . . . S LEXNDSS=LEXNDSS+1 N LEXOK,LEXMC S LEXMC=$G(^LEX(LEXFI,LEXIEN,5,LEXS,0))
 . . . . . S LEXOK=0 S:LEXMC=LEXSTR LEXOK=1 I 'LEXOK D
 . . . . . . S LEXSER=LEXSER+1 K:'$D(LEXTEST) ^LEX(LEXFI,LEXIEN,5,LEXIDX,LEXSTR,LEXS) S:$L(LEXMC) ^LEX(LEXFI,LEXIEN,5,LEXIDX,LEXMC,LEXS)=""
 . . . . . . I '$D(ZTQUEUED) W !,?10,757.18,?19,LEXIDX,?30,$E(LEXSTR,1,26),?58,"  ",LEXIEN,"/",LEXS
 . . . S LEXSTR=0 F  S LEXSTR=$O(^LEX(LEXFI,LEXIEN,5,LEXSTR)) Q:+LEXSTR'>0  D
 . . . . N DA,X S X=$P($G(^LEX(LEXFI,LEXIEN,5,LEXSTR,0)),"^",1),DA(1)=LEXIEN,DA=LEXSTR
 . . . . I $L(X) I '$D(^LEX(LEXFI,DA(1),5,LEXIDX,X,DA)) D  Q
 . . . . . S LEXSER=LEXSER+1,^LEX(LEXFI,DA(1),5,LEXIDX,X,DA)=""
 . . . . . I '$D(ZTQUEUED) W !,?10,757.18,?19,LEXIDX,?30,"Missing",?58,"  ",DA(1),"/",DA
 S LEXIEN=0 F  S LEXIEN=$O(^LEX(LEXFI,LEXIEN)) Q:+LEXIEN'>0  D
 . N DA,DIK,X S DA=LEXIEN,X=$$UP^XLFSTR($G(^LEX(LEXFI,LEXIEN,0))) Q:'$L(X)
 . I '$D(^LEX(LEXFI,"B",$E(X,1,63),DA)) D
 . . S LEXERR=LEXERR+1 I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,"Missing",?58,"  ",DA
 . S:$L(X) ^LEX(LEXFI,"B",$E(X,1,63),DA)=""
 . N LEXS S LEXS=0 F  S LEXS=$O(^LEX(LEXFI,LEXIEN,4,LEXS)) Q:+LEXS'>0  D
 . . N DA,DIK,X S DA(1)=LEXIEN,DA=LEXS,X=$P($G(^LEX(LEXFI,DA(1),4,DA,0)),"^",1) Q:'$L(X)
 . . I '$D(^LEX(LEXFI,DA(1),4,"B",X,DA)) D
 . . . S LEXNER=LEXNER+1 I '$D(ZTQUEUED) W !,?10,757.17,?19,LEXIDX,?30,"Missing",?58,"  ",DA(1),"/",DA
 . . S:$L(X) ^LEX(LEXFI,DA(1),4,"B",X,DA)=""
 . S LEXS=0 F  S LEXS=$O(^LEX(LEXFI,LEXIEN,5,LEXS)) Q:+LEXS'>0  D
 . . N DA,DIK,X S DA(1)=LEXIEN,DA=LEXS,X=$P($G(^LEX(LEXFI,DA(1),5,DA,0)),"^",1) Q:'$L(X)
 . . I '$D(^LEX(LEXFI,DA(1),5,"B",X,DA)) D
 . . . S LEXSER=LEXSER+1 I '$D(ZTQUEUED) W !,?10,757.18,?19,LEXIDX,?30,"Missing",?58,"  ",DA(1),"/",DA
 . . S:$L(X) ^LEX(LEXFI,DA(1),5,"B",X,DA)=""
 S LEXERR=$S(+LEXERR>0:LEXERR,1:"") I '$D(ZTQUEUED) W !,$J(LEXERR,5),?8,LEXFI,?19,LEXIDX,?30,LEXIDXT
 S LEXNER=$S(+LEXNER>0:LEXNER,1:"") I '$D(ZTQUEUED) W !,$J(LEXNER,5),?10,757.17,?19,LEXIDX,?30,LEXIDNT
 S LEXSER=$S(+LEXSER>0:LEXSER,1:"") I '$D(ZTQUEUED) W !,$J(LEXSER,5),?10,757.18,?19,LEXIDX,?30,LEXIDST
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REP^LEXRXXS(LEXFI,LEXFI,LEXIDX,LEXNDS,LEXERR,LEXIDXT,LEXELP)
 D REP^LEXRXXS(LEXFI,757.17,LEXIDX,LEXNDSN,LEXNER,LEXIDNT)
 D REP^LEXRXXS(LEXFI,757.18,LEXIDX,LEXNDSS,LEXSER,LEXIDST)
 Q
RADC ;   Index    ^LEX(757.01,"ADC",1,IEN)
 W:'$D(ZTQUEUED) ! N DA,DIK,LEXBEG,LEXDF,LEXDIF,LEXELP,LEXEND,LEXERR,LEXFI,LEXIDX,LEXIDXT,LEXIEN,LEXNDS,LEXOK,LEXSTR
 S LEXFI="757.01"
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,"Repairing File #757.01 ""ADC""") Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT,(LEXNDS,LEXERR)=0,LEXSTR="",LEXFI=757.01,LEXIDX="ADC",LEXIDXT="^LEX(757.01,""ADC"",1,IEN)"
 F  S LEXSTR=$O(^LEX(LEXFI,LEXIDX,LEXSTR)) Q:'$L(LEXSTR)  D
 . N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN)) Q:+LEXIEN'>0  D
 . . S LEXNDS=LEXNDS+1 I '$D(^LEX(LEXFI,LEXIEN,0)) D  Q
 . . . S LEXERR=LEXERR+1 K:'$D(LEXTEST) ^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN)
 . . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,LEXSTR,?58,"  ",LEXIEN
 . . N LEXOK,LEXDF S LEXDF=+($P($G(^LEX(LEXFI,LEXIEN,1)),"^",5))
 . . S LEXOK=0 S:LEXDF=LEXSTR LEXOK=1 I 'LEXOK D
 . . . S LEXERR=LEXERR+1 K:'$D(LEXTEST) ^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN) S:$L(LEXDF) ^LEX(LEXFI,LEXIDX,LEXDF,LEXIEN)=""
 . . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,LEXSTR,?58,"  ",LEXIEN
 S LEXIEN=0 F  S LEXIEN=$O(^LEX(LEXFI,LEXIEN)) Q:+LEXIEN'>0  D
 . N DA,DIK,X S DA=LEXIEN,X=$P($G(^LEX(LEXFI,+DA,1)),"^",5)
 . I +X'>0,$D(^LEX(LEXFI,"ADC",+X,+DA)) D  Q
 . . S LEXERR=LEXERR+1
 . . K:'$D(LEXTEST) ^LEX(LEXFI,"ADC",+X,+DA),^LEX(LEXFI,"ADC",1,+DA)
 . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,"Invalid (0)",?58,"  ",DA
 . I +X>0,'$D(^LEX(LEXFI,"ADC",+X,+DA)) D  Q
 . . Q:+X'=1  S LEXERR=LEXERR+1
 . . S:'$D(LEXTEST) ^LEX(LEXFI,"ADC",+X,+DA)=""
 . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,"Missing",?58,"  ",DA
 . S:+X>0 ^LEX(LEXFI,"ADC",+X,+DA)=""
 . I +X>0,+X'=1 D  Q
 . . S LEXERR=LEXERR+1
 . . K:'$D(LEXTEST) ^LEX(LEXFI,"ADC",+X,+DA)
 . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,"Invalid (>1)",?58,"  ",DA
 . K:'$D(LEXTEST)&(+X'=1) ^LEX(LEXFI,"ADC",+X,+DA),^LEX(LEXFI,"ADC",1,+DA)
 S LEXERR=$S(+LEXERR>0:LEXERR,1:"") I '$D(ZTQUEUED) W !,$J(LEXERR,5),?8,LEXFI,?19,LEXIDX,?30,LEXIDXT
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REP^LEXRXXS(LEXFI,LEXFI,LEXIDX,LEXNDS,LEXERR,LEXIDXT,LEXELP)
 Q
RADTERM ;   Index    ^LEX(757.01,"ADTERM",DT,IEN) 
 N DA,DIK,LEXBEG,LEXDE,LEXDF,LEXDIF,LEXELP,LEXEND,LEXERR,LEXFI,LEXIDX,LEXIDXT,LEXIEN,LEXNDS,LEXOK,LEXSTR
 S LEXFI="757.01"
 N LEXTC S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,"Repairing File #757.01 ""ADTERM""") Q:LEXTC=1
 S LEXBEG=$$NOW^XLFDT,(LEXNDS,LEXERR)=0,LEXSTR="",LEXFI=757.01,LEXIDX="ADTERM",LEXIDXT="^LEX(757.01,""ADTERM"",EXP,IEN)"
 F  S LEXSTR=$O(^LEX(LEXFI,LEXIDX,LEXSTR)) Q:'$L(LEXSTR)  D
 . N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN)) Q:+LEXIEN'>0  D
 . . S LEXNDS=LEXNDS+1 I '$D(^LEX(LEXFI,LEXIEN,0)) D  Q
 . . . S LEXERR=LEXERR+1 K:'$D(LEXTEST) ^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN)
 . . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,LEXSTR,?58,"  ",LEXIEN
 . . N LEXOK,LEXDF,LEXDE S LEXDF=+($P($G(^LEX(LEXFI,LEXIEN,1)),"^",5))
 . . S LEXDE=$E($P($G(^LEX(LEXFI,LEXIEN,0)),U,1),1,63)
 . . S LEXOK=0 S:LEXDE=LEXSTR LEXOK=1 I 'LEXOK D
 . . . S LEXERR=LEXERR+1
 . . . K:'$D(LEXTEST) ^LEX(LEXFI,LEXIDX,LEXSTR,LEXIEN) S:+LEXDF>0&($L(LEXDE)) ^LEX(LEXFI,LEXIDX,LEXDE,LEXIEN)=""
 . . . I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,$E(LEXSTR,1,20),$S($L(LEXSTR)>20:"...",1:""),?58,"  ",LEXIEN
 S LEXIEN=0 F  S LEXIEN=$O(^LEX(LEXFI,LEXIEN)) Q:+LEXIEN'>0  D
 . N DA,DIK,LEXDF,X S DA=LEXIEN,X=$P($G(^LEX(LEXFI,DA,0)),"^",1) Q:'$L(X)
 . S LEXDF=+($P($G(^LEX(LEXFI,DA,1)),"^",5))
 . I +LEXDF>0,'$D(^LEX(LEXFI,LEXIDX,$E(X,1,63),DA)) D
 . . S LEXERR=LEXERR+1 I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,"Missing",?58,"  ",DA
 . I +LEXDF'>0,$D(^LEX(LEXFI,LEXIDX,$E(X,1,63),DA)) D
 . . S LEXERR=LEXERR+1 I '$D(ZTQUEUED) W !,?8,LEXFI,?19,LEXIDX,?30,"Invalid (deleted)",?58,"  ",DA
 . S:$L(X)&(+LEXDF>0) ^LEX(LEXFI,LEXIDX,$E(X,1,63),DA)=""
 . K:$L(X)&(+LEXDF'>0) ^LEX(LEXFI,LEXIDX,$E(X,1,63),DA)
 S LEXERR=$S(+LEXERR>0:LEXERR,1:"") I '$D(ZTQUEUED) W !,$J(LEXERR,5),?8,LEXFI,?19,LEXIDX,?30,LEXIDXT
 S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REP^LEXRXXS(LEXFI,LEXFI,LEXIDX,LEXNDS,LEXERR,LEXIDXT,LEXELP)
 Q
 ;              
 ; Miscellaneous
SET ;   Re-Index Expression file 757.01 (Set logic only)
 Q:'$D(LEXSET)  N LEXTC,LEXPRE,LEXBEG,LEXEND,LEXELP,LEXNM,LEXFI,LEXRT
 N LEXOUT,LEXMSG S LEXFI=757.01
 D FILE^DID(LEXFI,"N","GLOBAL NAME","LEXOUT","LEXMSG")
 S LEXRT=$G(LEXOUT("GLOBAL NAME")) Q:LEXRT'["^LEX"
 S LEXPRE=$G(^TMP("LEXRX",$J,"T",1,"ELAP"))
 S LEXBEG=$$NOW^XLFDT,LEXNM=$$FN^LEXRXXM(LEXFI)
 S LEXTC=$$UPD^LEXRXXT3($G(LEXNAM),,("Re-Indexing File #"_LEXFI))
 Q:LEXTC=1  I '$D(ZTQUEUED) W !,?8,"Re-Indexing",!
 D DL,MC
 N LEXIEN,LEXP3,LEXP4 S (LEXP3,LEXP4,LEXIEN)=0
 F  S LEXIEN=$O(^LEX(LEXFI,LEXIEN)) Q:+LEXIEN'>0  D
 . S LEXP3=LEXIEN,LEXP4=LEXP4+1
 . N DA,DIK S DA=LEXIEN,DIK=LEXRT D IX1^DIK
 D RL,SL S $P(^LEX(LEXFI,0),"^",3)=LEXP3,$P(^LEX(LEXFI,0),"^",4)=LEXP4
 Q:$D(LEXQ)  S LEXEND=$$NOW^XLFDT,LEXELP=$$FMDIFF^XLFDT(LEXEND,LEXBEG,3)
 S:$E(LEXELP,1)=" "&($E(LEXELP,3)=":") LEXELP=$TR(LEXELP," ","0")
 D REP^LEXRXXS(LEXFI,LEXFI,"ALLIX",,,"Re-Index",LEXELP)
 S LEXELP=$$ADDT^LEXRXXM(LEXELP,LEXPRE)
 S ^TMP("LEXRX",$J,"T",1,"ELAP")=LEXELP
 Q
DL ;     De-Link AWRD
 N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(^LEX(757.05,LEXIEN)) Q:+LEXIEN'>0  D
 . N LEXNC,LEXND,LEXNN,LEXWRD S LEXND=$G(^LEX(757.05,+LEXIEN,0)) Q:$P(LEXND,"^",3)'="L"  S LEXWRD=$P(LEXND,"^",1)
 . S LEXNN="^LEX(757.01,""AWRD"","""_LEXWRD_""")",LEXNC="^LEX(757.01,""AWRD"","""_LEXWRD_""","
 . F  S LEXNN=$Q(@LEXNN) Q:'$L(LEXNN)!(LEXNN'[LEXNC)  K:LEXNN[",""LINKED"")" @LEXNN
 Q
MC ;     Major Concept Map File
 N LEXIEN S LEXIEN=0 F  S LEXIEN=$O(^LEX(757,LEXIEN)) Q:+LEXIEN'>0  D
 . N DA,DIK S DA=LEXIEN,DIK="^LEX(757," D IX1^DIK
 Q
RL ;     Re-Link 757.05
 N LEXIEN S LEXIEN=" " F  S LEXIEN=$O(^LEX(757.05,LEXIEN)) Q:'$L(LEXIEN)  K:LEXIEN?1U.U ^LEX(757.05,LEXIEN)
 S LEXIEN=0 F  S LEXIEN=$O(^LEX(757.05,LEXIEN)) Q:+LEXIEN'>0  D
 . N DA,DIK S DA=LEXIEN K ^LEX(757.05,DA,1,"B") S DA=LEXIEN,DIK="^LEX(757.05," D IX1^DIK
 Q
SL ;     String Length ASL
 N LEXSTR S LEXSTR="" F  S LEXSTR=$O(^LEX(757.01,"ASL",LEXSTR)) Q:'$L(LEXSTR)  D
 . N LEXSCT,LEXPSCT S LEXSCT=$$SCT^LEXRXC3(LEXSTR)
 . S LEXPSCT=$O(^LEX(757.01,"ASL",LEXSTR,0))
 . I +LEXPSCT>0,+LEXSCT'>0 K ^LEX(757.01,"ASL",LEXSTR,+LEXPSCT)
 . I +LEXPSCT>0,+LEXSCT>0,+LEXPSCT'=LEXSCT D
 . . K ^LEX(757.01,"ASL",LEXSTR,+LEXPSCT) S ^LEX(757.01,"ASL",LEXSTR,+LEXSCT)=""
 Q
CLR ;   Clear
 K LEXNAM,LEXSET,LEXTEST,ZTQUEUED,LEXQ
 Q