;LVH SYSTEM UTILITY; [ 06/16/2003 4:57 PM ] Quit ; USERJOBS(User) New I,Devs,Jobs Set Devs=$$USERDEVS($G(User)),Jobs="" If $L(Devs) For I=1:1:$L(Devs,",") Set $P(Jobs,",",I)=$$JOB($P(Devs,",",I)) Quit Jobs ; USERDEVS(User) New UserId,UserDev,UserDevs,Device If $L($G(User)) Do .Set (Device,UserDev)="" .For Set Device=$O(^cLOG("ADM","DDB",0,Device)) Quit:Device="" Do ..Set R=^cLOG("ADM","DDB",0,Device) ..Set:$P(R,"\")=User UserDev=UserDev_";"_Device .Set $E(UserDev)="" .Quit:$L(UserDev) .Set UserId=$$USERID^vhUSER(User) .If 'UserId Set UserDev="" Quit .Set UserDev=$$USERDEV^vhUSER(UserId) Else Set UserDev=$$IO^cQ5 For I=1:1:$L(UserDev,";") Set:$L($P(UserDev,";",I)) $P(UserDev,";",I)=$$DDB($P(UserDev,";",I)) Set UserDevs="" For I=1:1:$L(UserDev,";") Set:$L($P(UserDev,";",I)) UserDevs=UserDevs_","_$P(UserDev,";",I) Set $E(UserDevs)="" Quit UserDevs ; DDB(%Q5) New I,Device,InUse Set:'$G(%Q5) %Q5=$$IO^cQ5 Set Device="",InUse=$$INUSE() For I=$L(InUse,","):-1:1 If $P($P(InUse,",",I),"|",2)'="TNT" Set $P(InUse,",",I,I+999)=$P(InUse,",",I+1,I+999) If $L(InUse) Do .For Do Quit:InUse="" ..Set:$$IO^cQ5($P(InUse,","))=%Q5 Device=Device_","_$P(InUse,",") ..Set InUse=$P(InUse,",",2,999) Set $E(Device)="" Quit Device ; JOB(Devices) New I,Device,Job,Jobs Set:$G(Devices)="" Devices=$I For I=1:1:$L(Devices,",") Set Device=$P(Devices,",",I),Job=$P(Device,"|",$L(Device,"|")),$P(Jobs,",",I)=Job Quit Jobs ; DEVICE(Jobs) New I,Job,Device,Devices Set:'$G(Jobs) Jobs=$J For I=1:1:$L(Jobs,",") Do . Set Job=$P(Jobs,",",I) . Xecute "Set Device=$ZUTIL(67,7,Job)" . Do:$L(Device)=32 . . Set:$E(Device,1,2)="T|" Device="|TNT|"_$E(Device,3,99) . . Set:$E(Device,1,3)="NT|" Device="|TNT|"_$E(Device,4,99) . . Set:$E(Device,1,4)="TNT|" Device="|TNT|"_$E(Device,5,99) . Set $P(Devices,",",I)=Device Quit Devices ; IOcQ5(I) Set I=$$JOB($G(I)) Set:I="" I=$$JOB() Set I="|TNT|"_I Quit $$IO^cQ5(I) ; UCI(Job,Device) New Uci Set Job=$G(Job),Device=$G(Device) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Xecute "Set Uci=$ZUTIL(67,6,Job)" Quit $G(Uci) ; PRIORITY(Job,Device) New Priority Set Job=$G(Job),Device=$G(Device) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Do .Set Priority=$V(20,Job,2) Quit $G(Priority) ; ROUTINE(Job,Device,Routine) ; Job : geeft de routine voor die job ; Device : geeft de routine voor dat device ; Routine : geeft de devices die deze routine verwerken New I,Jobs,InUse Set Job=$G(Job),Device=$G(Device),Routine=$G(Routine) If $L(Routine) Do Quit Device .If 'Job Do ..Set InUse=$$INUSE() ..Set Jobs="" Set:Device Job=$$JOB(Device) ..Quit:Job ..For I=1:1:$L(InUse,",") If $$ROUTINE(,$P(InUse,",",I))=Routine Set Jobs=Jobs_","_$$JOB($P(InUse,",",I)) ..Set $E(Jobs)="",Job=Jobs .Set Device="" .If $L(Job) For I=1:1:$L(Job,",") Set $P(Device,",",I)=$$DEVICE($P(Job,",",I)) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Do .Xecute "Set Routine=$ZUTIL(67,5,Job)" Quit $G(Routine) ; routine(Job,Device,Routine) ; Job : geeft de routine voor die job ; Device : geeft de routine voor dat device ; Routine : geeft de devices die deze routine verwerken New I,Jobs,InUse Set Job=$G(Job),Device=$G(Device),Routine=$G(Routine) If $L(Routine) Do Quit Device .If 'Job Do ..Set InUse=$$INUSE(,,"J") ..Set Jobs="" Set:Device Job=$$JOB(Device) ..Quit:Job ..For I=1:1:$L(InUse,",") If $$ROUTINE($P(InUse,",",I))=Routine Set Jobs=Jobs_","_$$JOB($P(InUse,",",I)) ..Set $E(Jobs)="",Job=Jobs .Set Device="" .If $L(Job) For I=1:1:$L(Job,",") Set $P(Device,",",I)=$$DEVICE($P(Job,",",I)) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Do .Xecute "Set Routine=$ZUTIL(67,5,Job)" Quit $G(Routine) ; PARTSIZE(Job,Device,Type) ; Type = 0 current ; = 1 maximum ; = 2 current/maximum New PartSize Set Job=$G(Job),Device=$G(Device) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Do .Set Type=$G(Type) Set:Type>2 Type=2 .Set:Type'=1 PartSize=$J($V(104,Job,4)/1024,0,1) Set:Type=2 PartSize=PartSize_"/" .Set:Type PartSize=$G(PartSize)_($V(108,Job,4)\1024) Quit $G(PartSize) ; STATUS(Job,Device) New Status Set Job=$G(Job),Device=$G(Device) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Do .Set Status=$V(58,Job,1) .Set Status=$P($T(@Status),";",2) .Set:Status="" Status="Queue-"_$V(58,Job,1) .If Status="TermO" Set Status=Status_"-"_$$IO($V(152,Job,0)-58) .If Status="TermI" Set Status=Status_"-"_$$IO($V(152,Job,0)-66) .If Status="TermOpn" Set Status=Status_"-"_$$IO($V(152,Job,0)-66) .If Status="TermUse" Set Status=Status_"-"_$$IO($V(152,Job,0)-66) .If Status="TermCls" Set Status=Status_"-"_$$IO($V(152,Job,0)-66) .If Status="HostCmd" Set Status=Status_"-"_$$IO($V(152,Job,0)-66) .If Status="IjcI" Set Status=Status_"-"_$$IO($V(152,Job,0)-20) .If Status="IjcO" Set Status=Status_"-"_$$IO($V(152,Job,0)-24)+1 .If Status="Device" Set Status=Status_"-"_$V(112,Job,4) Quit $G(Status) ; COMMANDS(Job,Device,Type) ; Type = 0 total ; = 1 incr ; = 2 total/incr New Commands Set Job=$G(Job),Device=$G(Device) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) If Job Do .Set Type=$G(Type) Set:Type>2 Type=2 .Set:Type'=1 Commands=$V(96,Job,4) Set:Type=2 Commands=Commands_"/" .Set:Type Commands=$G(Commands)_$V(100,Job,4) Quit $G(Commands) ; IO(DDB) ; New DDBN,DDBT,DDBX,IX,OSYS Set OSYS=$ZB($V(0,-4,2),15,1) If 'OSYS!($V(0,-4,2)#16=8) Quit $V(DDB,-3,4) Set DDBT=$V(7,-5)+4,DDBN=$V($V(5,-5),-3,2) View 112:$J:DDB:4 Set DDBX=$V(112,$J,4,1) Set IX=$F($V(DDBT,-3,DDBN*4,1),DDBX) Quit:IX=0 0 Set IX=IX-1 Quit:IX/4=(IX\4) IX/4 For IX=1,3:1:19,64:1:199,224:1:DDBN Quit:DDB=$V(4*IX+$V(7,-5),-3,0) Quit IX ; INUSE(Job,Device,DevicesJobs) ; Not Device = all in use ; Device = in use (1) or not in use (0) ; DevicesJobs = "D" geeft de divices terug (default) ; = "J" geeft de jobnummers terug New B,I,J,K,DEV,JOB,maxpid,pid Set Job=$G(Job),Device=$G(Device),DevicesJobs=$G(DevicesJobs,"G") If Job Do .Set Device=$$DEVICE(Job),DEV=Device'="" Else Do .Set J="" .For Set J=$O(^$JOB(J)) Quit:J="" Set K=$$DEVICE(J) Set:$L(K) DEV(K)=J .Set (K,DEV)="" .For Set K=$O(DEV(K)) Quit:K="" Set DEV=DEV_","_K .Set $E(DEV)="" Set:$L(Device) DEV=(","_DEV_",")[(","_Device_",") If DevicesJobs="J" For I=1:1:$L(DEV,",") Do .Set J=$G(DEV($P(DEV,",",I))) .Set:'J J=$$JOB($P(DEV,",",I)) .Set $P(DEV,",",I)=J Quit DEV ; VAR(Job,Device) Set Job=$G(Job),Device=$G(Device) If 'Job Set:Device="" Device=$I Set Job=$$JOB(Device) Quit:'Job Quit:Job=$J Kill (Job,Device) Set Device=$$DEVICE(Job) If $L(Device),$$INUSE(,Device) Set Job=$$JOB(Device) Do EXEC^vhSW("Do VAR^JOBEXAM(Job)") Quit ; MAXPART New R,SMaxPart,CInUse,UInUse,Devs,UMaxPart If '$D(Q) New Do INIT^vhTERMINA If '$D(CUserId) New CUserId Set CUserId=$$DEVUSER^vhUSER($$IO^cQ5) If $ZV["MSM",CUserId Do .Set SMaxPart=$V($V(3,-5),-3,0),CInUse=$V(168,-4,2),UInUse=$L($$INUSE(),",") .Set Devs=$L($$USERDEVS(),","),UMaxPart=$P($G(^vhUSER("D",CUserId)),D,7) Set:'UMaxPart UMaxPart=2 .If UInUse>40,Devs>UMaxPart Do ..Write @F11,@F1,!,"No partitions available" ..If $L(CUserId,";")=1 Do ...Set R=$G(^LOGPART(CUserId,+$H)) ...Set:R="" $P(R,D,2)=Devs-1,$P(R,D,Devs+1)=$P($H,",",2) ...Set:'$P(R,D) $P(R,D)=$P($H,",",2),^LOGPART(CUserId,+$H)=R ..Hang 2 ..Halt .If $L(CUserId,";")=1 Do ..Set R=$G(^LOGPART(CUserId,+$H)) ..Set:Devs>$P(R,D,2) $P(R,D,2)=Devs,$P(R,D,Devs+2)=$P($H,",",2),^LOGPART(CUserId,+$H)=R Quit ; LISTPART New Do INIT^vhTERMINA Write !,"Naam Jobs Devices" Write !,"-------------------------------------------------------------" Set InUse=$$INUSE,AantIU=$L(InUse,",") For Set Device=$P(InUse,","),InUse=$P(InUse,",",2,999) Quit:Device="" Do .Set Device=$$IO^cQ5(Device) .Quit:Device="" .Set User=$P(^cLOG("ADM","DDB",0,Device),"\") .Set:User'="" Users(User)="" Set User="" For Set User=$O(Users(User)) Quit:User="" Do .Set UserJobs=$$USERJOBS(User) .Set UserDevs=$$USERDEVS(User) .Quit:UserDevs="" .Write !,$E(User,1,20),?25,"(",$$IO^cQ5($P(UserDevs,",")),")",?35,UserJobs,?50,UserDevs Write !,"-------------------------------------------------------------" Write !,"Totaal aantal",?25,AantIU Quit ; 0 ;Running 1 ;RunQue 2 ;WaitQ1 3 ;WaitQ1a 4 ;WaitQ2 5 ;WaitQ2a 6 ;WaitQ3 7 ;WaitQ3a 8 ;Qavail 9 ;Qpart 10 ;Buff 11 ;Lock 12 ;Device 13 ;Hang 14 ;Qspecial 15 ;DDP 16 ;ServerQ 17 ;Qlat_sol 18 ;Qlat_cmd 19 ;Qlat_si 20 ;Latsvbuf 21 ;CIRsuspend 23 ;DeadQ 24 ;MemoryQ 25 ;LckTbFull 30 ;BufInUse 31 ;DDPbuff 32 ;Muserver 33 ;Journal 34 ;ShrdBuf 35 ;ApiFunc 36 ;ApiIn 37 ;ApiOut 40 ;TermI 41 ;TermO 42 ;FastPath 43 ;TapeIO 44 ;AsciiObf 45 ;AsciiIbf 46 ;IjcI 47 ;IjcO 48 ;TermOpn 49 ;TermUse 50 ;DiskIO 51 ;TermCls 52 ;HostCmd 53 ;HFS_IO 54 ;Jrnl_In 55 ;Jrnl_Out 56 ;DDPreq 57 ;DDPcredit 58 ;VGPfetch 59 ;VGPupdate 70 ;Sleep 71 ;Fork 72 ;DTR 73 ;TsetSpin 74 ;MPLock 75 ;Jrnl_out 76 ;Jrnl_Dmn 77 ;GenChng 78 ;Bij_Buff 79 ;Bij_Full 80 ;BIJ_IO 81 ;BIJ_IObp 99 ;MSM-GUI 100 ;VXD_get