Index: FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZOSVONT.m
===================================================================
--- FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZOSVONT.m	(revision 631)
+++ FOIAVistA/tag/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/ZOSVONT.m	(revision 636)
@@ -1,5 +1,4 @@
-%ZOSV ;SFISC/AC - $View commands for Open M for NT.  ;03/03/2008
- ;;8.0;KERNEL;**34,94,107,118,136,215,293,284,385,425,440**;Jul 10, 1995;Build 13
- ;Per VHA Directive 2004-038, this routine should not be modified
+%ZOSV ;SFISC/AC - $View commands for Open M for NT.  ;4/26/07  09:39
+ ;;8.0;KERNEL;**34,94,107,118,136,215,293,284,385,425**;Jul 10, 1995;Build 18
 ACTJ() ;# Active jobs
  N %,V,Y S V=$$VERSION()
@@ -14,11 +13,11 @@
  ;maxpid: from %SS
  I V<5 D  Q AVJ
- . N PORT,T,X,MAXPID,LMFLIM
- . S $ET="",MAXPID=$V($ZU(40,2,118),-2,4)
- . X "S ZOSV=$ZU(5),%=$ZU(5,""%SYS"") S LMFLIM=$$inquire^LMFCLI,%=$ZU(5,ZOSV)" ;Get the license info
+ . N port,t,x,maxpid,lmflim
+ . S $ET="",maxpid=$V($ZU(40,2,118),-2,4)
+ . X "S ZOSV=$ZU(5),%=$ZU(5,""%SYS"") S lmflim=$$inquire^LMFCLI,%=$ZU(5,ZOSV)" ;Get the license info
  . ;Add together the enterprise and division licenses avaliable
- . S X=$P(LMFLIM,";",2)+$P($P(LMFLIM,"|",2),";",2)
- . S T=+LMFLIM+$P(LMFLIM,"|",2) ;Check the license total
- . S AVJ=$S(T<MAXPID:X,1:MAXPID-$$ACTJ) ;Return the smaller of license or pid
+ . S x=$P(lmflim,";",2)+$P($P(lmflim,"|",2),";",2)
+ . S t=+lmflim+$P(lmflim,"|",2) ;Check the license total
+ . S AVJ=$S(t<maxpid:x,1:maxpid-$$ACTJ) ;Return the smaller of license or pid
  ;To get available jobs from Cache 5.0 up
  I V'<5 D  Q AVJ
@@ -39,5 +38,5 @@
  ;
 GETPEER() ;Get the PEER tcp/ip address
- N PEER,NL,$ET S NL="",PEER="",$ET="S $EC=NL Q NL"
+ N PEER,NL,$ET S NL="",$ET="S $EC=NL Q NL",PEER=""
  I $$OS="VMS" S PEER=$ZF("TRNLNM","VISTA$IP")
  I '$L(PEER) S PEER=$ZU(111,0) S:$L(PEER) PEER=$A(PEER,1)_"."_$A(PEER,2)_"."_$A(PEER,3)_"."_$A(PEER,4)
@@ -45,17 +44,16 @@
  ;
 SHARELIC(TYPE) ;See if can share a C/S license
- ;Per Sandy Waal 10/18/2003: With Cache 5.0, your telnet and IP connections are now handled properly.
- ;N %,%N,%2,UID,%V,$ET S $ET="S $EC="""" Q",%V=$$VERSION()
- ;I %V'<5 Q
  ;Type is 1 for C/S and 0 for Telnet
- ;I %V<3.1 X:TYPE "S %N=$ZU(5),%2=$ZU(5,""%SYS""),%2=$$GetLic^LMFCLI,%N=$ZU(5,%N)" Q
- ;I %V<5 S:TYPE %=$$GetCSLic^%LICENSE S:'TYPE %=$$ShareLic^%LICENSE
- ;S $EC=""
+ N %,%N,%2,UID,%V,$ET S $ET="S $EC="""" Q",%V=$$VERSION()
+ I %V<3.1 X:TYPE "S %N=$ZU(5),%2=$ZU(5,""%SYS""),%2=$$GetLic^LMFCLI,%N=$ZU(5,%N)" Q
+ I %V<5 S:TYPE %=$$GetCSLic^%LICENSE S:'TYPE %=$$ShareLic^%LICENSE
+ ;Per Sandy Waal 10/18/2003: With Cache' 5.0, your telnet and IP connections are now handled properly.
+ I %V'<5 S %V=%V
+ S $EC=""
  Q
- ;
 JOBPAR ;See if X points to a valid Job. Return its UCI.
- N NL,$ET S Y="",NL="",$ET="S $EC=NL Q"
- I $D(^$JOB(X)) S Y=$V(-1,X),Y=$P(Y,"^",14)_","_^%ZOSF("VOL")
- Q
+ N ZJ S Y="",$ZT="JOBX"
+ Q:'$D(^$JOB(X))  S Y=$V(-1,X),Y=$P(Y,"^",14)_","_^%ZOSF("VOL")
+JOBX Q
  ;
 NOLOG ;4096 is switch 12 - sign on inhibited.
@@ -63,5 +61,5 @@
  ;
 PROGMODE() ;Check if in PROG mode
- Q $ZJOB#2
+ Q $ZJ#2
  ;
 PRGMODE ;
@@ -72,10 +70,9 @@
  D UCI S XUCI=Y,XQZ="PRGM^ZUA[MGR]",XUSLNT=1 D DO^%XUCI D ^%PMODE U $I:(:"+B+C+R") S $ZT="" Q
  Q
-LGR() ;Last Global ref.
- N $ET,NL S NL="",$ET="S $EC=NL Q NL"
- Q $ZR
+LGR() S $ZT="LGRX^%ZOSV"
+ Q $ZR ;Last Global ref.
+LGRX Q ""
  ;
-EC() ;Error code
- Q $ZE
+EC() Q $ZE ;Error code
  ;
 DOLRO ;SAVE ENTIRE SYMBOL TABLE IN LOCATION SPECIFIED BY X
@@ -95,12 +92,11 @@
  Q
  ;
-PARSIZ ;Old and not used.
+PARSIZ ;
  S X=3
  Q
  ;
-DEVOPN ;List of Devices opened, Not used
+DEVOPN ;List of Devices opened
  ;Returns variable Y. Y=Devices owned separated by a comma
  Q
- ;
 DEVOK ;
  S Y=0,X1=$G(X1) Q:X=2  Q:(X1="HFS")!(X1="SPL")!(X1="MT")!(X1="CHAN")  ;Quit w/ OK for HFS, Spool, MT, TCP/IP
@@ -122,5 +118,5 @@
  ;
 OS() ;Return the OS NT, VMS, Unix
- Q $S($ZV["VMS":"VMS",$ZV["UNIX":"UNIX",$ZV["Linux":"UNIX",$ZV["Windows":"NT",$ZV["NT":"NT",1:"UNK")
+ Q $S($ZV["VMS":"VMS",$ZV["Windows":"NT",$ZV["NT":"NT",$ZV["UNIX":"UNIX",1:"UNK")
  ;
 SETNM(X) ;Set name, Fall into SETENV
@@ -131,10 +127,8 @@
  ;
 SID() ;System ID Ver 1
- N %1,%2,%3,%4,%5,T S T="~"
+ N %1,%2,%3,T S T="~"
  S %1=$ZU(5) ;namespace
  S %2=$ZU(12,"") ;directory
  I '$L(%2),$$VERSION'<5.2 S %2=$$defdir^%SYS.GLO(%1) ;remote directory
- S %3=$G(^XTV(8989.3,1,"SID")),%4=$P(%3,"^",4),%5=$P(%3,"^",5)
- I $L(%4),$L(%5),%2[%4 S %2=$P(%2,%4)_%5_$P(%2,%4,2,9)
  S %3=%1_T_%2 ;namespace~directory
  Q "1~"_%3
@@ -142,7 +136,8 @@
 PRI() ;Check if a mixed OS enviroment.
  ;Default return 1 unless we are on the secondary OS.
- ;Only Cache on a VMS(1)/Linux or NT(2) mix is supported now.
+ ;Only Cache on a VMS(1)/Linux(2) mix is supported now.
  N % S %=1
  I $P(^XTV(8989.3,1,0),"^",5),$$OS'="VMS" S %=2
+ ;I $P(^XTV(8989.3,1,0),"^",5),$$OS["NT" S %=2
  Q %
  ;
@@ -162,5 +157,5 @@
  Q 1
  ;
-T0 ; start RT clock, obsolete
+T0 ; start RT clock
  ;S XRT0=$H
  Q
