%ZOSV1 ;SFISC/AC,LL/DFH,sfisc/fyb - ;07/07/95 16:11
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
DEVOPN ;X=$J,Y=List of devices separated by a comma
N A,I,JA,JOB,DEV,CDEV,ODEV,PDEV
S X=$J D JSTAT
I 'ZVER S Y=$$jstat^%mjob(X),Y=$S($P(Y,"|",6)>0:$P(Y,"|",6)_",",1:"")_$P(Y,"|",9)_$E(",",$P(Y,"|",9)]"") Q
;S PDEV=$V(0,JA+18,-3),PDEV=$S(PDEV:$V(0,PDEV+2,-2),1:"-")
;S CDEV=$V(0,JA+22,-3),CDEV=$S(CDEV:$V(0,CDEV+2,-2),1:"-")
S PDEV=$P($zjob(X),"|",5)
S CDEV=$P($zjob(X),"|",6)
S ODEV="",JOB=$V(0,JA+10,-4)
;S A=$V(1,62,-3) I A,$V(0,A+4,-2) D JDEV ; includes parents cur device
S A=$V(1,38,-3)
F A=A:0 Q:'$V(0,A,-2) D:$V(0,A+4,-2)=JOB JDEV S A=A+$V(0,A,-2)
S Y=$S(CDEV:CDEV_",",1:"")_$E(ODEV,2,999)_$E(",",$E(ODEV,2,999)]"")
Q
JSTAT ; Get DTM data - X=Job Number
S X=$S($D(X)[0:$J,X'?1N.N:$J,1:X)
S ZVER=($P($ZVER,"/",2)'<4) ; ZVER=1 if Version 4
;S JA=$V(1,(X-1*2)+100,-2)*16
S JA=0
Q
JDEV ;
S DEV=$V(0,A+2,-2) I DEV,DEV'=PDEV S ODEV=ODEV_","_DEV
Q
;
FREEDEV ;
F P=$V($S($P($ZVER,"/",2)<4:4,1:1),38,-3):0 S L=$V(0,P,-2) Q:'L Q:'$V(0,P+4,-2)&($V(0,P+6,-1)=6) S P=P+L
;
S IO=$S(L:$V(0,P+2,-2),1:"") Q
JOBLIST ; Active Jobs delimited by comma
S Y=$$jobs^%mjob Q
;
SHUTDOWN ; Check shutdown flag
S Y=$S($P($ZVER,"/",2)<4:$V(4,0,-1)#2,1:$V(1,0,-1)#2)
Q
%ZOSV1 ;SFISC/AC,LL/DFH,sfisc/fyb - ;07/07/95 16:11
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
DEVOPN ;X=$J,Y=List of devices separated by a comma
+1 NEW A,I,JA,JOB,DEV,CDEV,ODEV,PDEV
+2 SET X=$JOB
DO JSTAT
+3 IF 'ZVER
SET Y=$$jstat^%mjob(X)
SET Y=$SELECT($PIECE(Y,"|",6)>0:$PIECE(Y,"|",6)_",",1:"")_$PIECE(Y,"|",9)_$EXTRACT(",",$PIECE(Y,"|",9)]"")
QUIT
+4 ;S PDEV=$V(0,JA+18,-3),PDEV=$S(PDEV:$V(0,PDEV+2,-2),1:"-")
+5 ;S CDEV=$V(0,JA+22,-3),CDEV=$S(CDEV:$V(0,CDEV+2,-2),1:"-")
+6
*** ERROR ***
SET PDEV=$PIECE($zjob(X),"|",5)
+7
*** ERROR ***
SET CDEV=$PIECE($zjob(X),"|",6)
+8 SET ODEV=""
SET JOB=$VIEW(0,JA+10,-4)
+9 ;S A=$V(1,62,-3) I A,$V(0,A+4,-2) D JDEV ; includes parents cur device
+10 SET A=$VIEW(1,38,-3)
+11 FOR A=A:0
IF '$VIEW(0,A,-2)
QUIT
IF $VIEW(0,A+4,-2)=JOB
DO JDEV
SET A=A+$VIEW(0,A,-2)
+12 SET Y=$SELECT(CDEV:CDEV_",",1:"")_$EXTRACT(ODEV,2,999)_$EXTRACT(",",$EXTRACT(ODEV,2,999)]"")
+13 QUIT
JSTAT ; Get DTM data - X=Job Number
+1 SET X=$SELECT($DATA(X)[0:$JOB,X'?1N.N:$JOB,1:X)
+2 ; ZVER=1 if Version 4
SET ZVER=($PIECE($ZVER,"/",2)'<4)
+3 ;S JA=$V(1,(X-1*2)+100,-2)*16
+4 SET JA=0
+5 QUIT
JDEV ;
+1 SET DEV=$VIEW(0,A+2,-2)
IF DEV
IF DEV'=PDEV
SET ODEV=ODEV_","_DEV
+2 QUIT
+3 ;
FREEDEV ;
+1 FOR P=$VIEW($SELECT($PIECE($ZVER,"/",2)<4:4,1:1),38,-3):0
SET L=$VIEW(0,P,-2)
IF 'L
QUIT
IF '$VIEW(0,P+4,-2)&($VIEW(0,P+6,-1)=6)
QUIT
SET P=P+L
+2 ;
+3 SET IO=$SELECT(L:$VIEW(0,P+2,-2),1:"")
QUIT
JOBLIST ; Active Jobs delimited by comma
+1 SET Y=$$jobs^%mjob
QUIT
+2 ;
SHUTDOWN ; Check shutdown flag
+1 SET Y=$SELECT($PIECE($ZVER,"/",2)<4:$VIEW(4,0,-1)#2,1:$VIEW(1,0,-1)#2)
+2 QUIT