C11 TITLE 'IEEAVM01 - AUTOMATIC VOLUME MOUNT ROUTINE' 00000001 * * * ðOCìEäHññ KOPPEKTéPOBKA: äATA 17.01.90 BPEMñ 04.16 * æOKõC 00000002 * 00000003 * FUNCTIONS: - WAIT FOR UNSOLICTED DEVICE END (ATTENTION INDEX=0) 00000004 * - READ DIRECT ACCESS VOLUME LABEL 00000005 * - COMPARE VOLUME SERIAL IN LABEL WITH UCB 00000006 * - MOVE NEW VOLUME SERIAL AND VTOC ADDRESS TO UCB, 00000007 * IF NESESSARY 00000008 * - WRITE TO OPERATOR ABOUT IT 00000009 * 00000010 * ENTRY: ATTACH FROM IEEAVMIN; R1 - ECB ADDRESS 00000011 * 00000012 * EXITS: NONE 00000013 * 00000014 * ìEHéHçPAä éBã çõT OTä. 23 ìATùûKO T: 219-07-07 * 00000015 SPACE 2 00000016 MACRO 00000017 &L #WTO &N 00000018 &L LA 0,&N 00000019 BAL 10,#WTO 00000020 MEND 00000021 SPACE 2 00000022 PRINT NOGEN 00000023 REQU BASE,3,RECB,4,RCVT,5,RUCB,6,RDEB,7,W1,8,W2,9 00000024 SPACE 2 00000025 UCB DSECT 00000026 USING UCB,RUCB 00000027 IEFUCBOB 00000028 SPACE 2 00000029 *********************************************************************** 00000030 * PROLOG, OPEN DCB * 00000031 *********************************************************************** 00000032 IEEAVM01 CSECT 00000033 USING *,BASE 00000034 SAVEAREA EQU * 00000035 LR BASE,15 00000036 LR RECB,1 00000037 L RCVT,16 00000038 LA 13,SAVEAREA 00000039 LOAD EP=SLBLDMSG LOAD MESSAGE BUILDING ROUTINE 00000040 ST 0,BLDMSGA 00000041 * 00000042 @GETDD DCB+40 00000043 L 15,16(15) LOAD UCB ADDRESS FOR IEFPDSI DD 00000044 MVC JFCB+118(6),UCBVOLI-UCB(15) MOVE VOLUME SERIAL TO JFCB 00000045 OPEN MF=(E,OPENL),TYPE=J OPEN DCB FOR READING LABELS 00000046 L RDEB,DCB+44 LOAD DEB ADDRESS FROM DCB 00000047 XC 38(4,RDEB),38(RDEB) LOW LIMIT OF EXTENT = 00000000 00000048 * 00000049 LA 1,DCBP 00000050 LINK EP=IEEAVM00 LINK ROUTINE TO OPEN PRESRES 00000051 EJECT 00000052 *********************************************************************** 00000053 * WAIT FOR UNSOLICTED DEVICE END; TEST UCB * 00000054 *********************************************************************** 00000055 MWAIT WAIT ECB=(RECB) WAIT FOR 'ATTENTION' (DEVICE END) 00000056 MVI 0(RECB),0 CLEAR HIGH BYTE OF ECB 00000057 L RUCB,0(RECB) LOAD UCB ADDRESS FROM ECB 00000058 CLI UCBID,X'FF' IS IT UCB ? 00000059 BNE MWAIT - NO 00000060 * 00000061 MODESET MF=(E,DISABLE) 00000062 TM UCBSTAT,UCBPRES+UCBSYSR RESIDENT DEVICE WILL NOT BE 00000063 BO MWAIT TESTED 00000064 TM UCBFL5,UCBNALOC IS DEVICE USED BY OLTEP ? 00000065 BO MWAIT 00000066 * 00000067 TMB UCBTBYT3,UCB3DACC,O,DASD 00000068 B MWAIT NOT DASD DEVICE - .? 00000069 SPACE 2 00000070 *********************************************************************** 00000071 * DEVICE END FROM DASD DEVICE * 00000072 *********************************************************************** 00000073 DASD DS 0H 00000074 TMB UCBDMCT,UCBMOUNT,O,MWAIT 00000075 TMB UCBSTAT,UCBALOC,O,MWAIT 00000076 TMB UCBFL1,UCBBUSYD+UCBERR,O,MWAIT 00000077 SPACE 2 00000078 *********************************************************************** 00000079 * READ DIRECT ACCESS VOLUME LABEL * 00000080 *********************************************************************** 00000081 TMB DCB+48,X'10',Z,MWAIT - DCB NOT OPENED, RETURN 00000082 * 00000083 IC 0,32(RDEB) 00000084 ST RUCB,32(RDEB) STORE NEW UCB ADDRESS INTO DEB 00000085 STC 0,32(RDEB) 00000086 * 00000087 IC W1,UCBFL4 SAVE UCBFL4 00000088 NI UCBFL4,X'07' ZERO VVR FLAGS 00000089 EXCP IOB START CHANNEL PROGRAM FOR READING LABEL 00000090 WAIT ECB=ECB WAIT FOR COMPLETION 00000091 CLIB ECB,X'7F',E,CNVVTOCA SUCCESFULL ? 00000092 STC W1,UCBFL4 NO - RESTORE VVR FLAGS 00000093 #WTO 1 WRITE ERROR MESSAGE 00000094 B MWAIT 00000095 SPACE 2 00000096 *********************************************************************** 00000097 * TEST UCB AND VOLUME LABEL * 00000098 *********************************************************************** 00000099 CNVVTOCA MVC CCHHR(3),=X'000000' 00000100 MVC CCHHR+3(5),VTOCADR 00000101 LR 1,RDEB 00000102 LA 2,CCHHR 00000103 L 15,32(RCVT) IECPRLTV 00000104 STM 9,13,SAVEAREA+12 00000105 BALR 14,15 00000106 LM 9,13,SAVEAREA+12 00000107 ST 0,VTOCTTR 00000108 MVC SAVESTAT,UCBSTAT 00000109 * 00000110 TMB UCBSTAT,UCBONLI,Z,MOUNT1 - DEVICE OFFLINE 00000111 * 00000112 C 0,UCBVTOC IS VTOC ADDRESS THE SAME ? 00000113 BNE OFFLINE - NO, REMOUNT 00000114 * 00000115 CLCB UCBVOLI,VOLSER,NE,OFFLINE - ANOTHER SERIAL 00000116 B MWAIT 00000117 SPACE 2 00000118 *********************************************************************** 00000119 * MOUNT DIRECT ACCESS VOLUME * 00000120 *********************************************************************** 00000121 OFFLINE DS 0H 00000122 #WTO 5 00000123 NI UCBSTAT,0 OFFLINE 00000124 MVI UCBSTAB,0 00000125 NI UCBFL5,UCBNALOC 00000126 XC UCBVOLI,UCBVOLI 00000127 XC UCBLTS,UCBLTS 00000128 SPACE 2 00000129 MOUNT1 L W1,40(RCVT) * TEST, IF ANOTHER VOLUME WITH 00000130 * THE SAME SERIAL MOUNTED * 00000131 UCBLOOP LH W2,0(W1) 00000132 N W2,=X'0000FFFF' 00000133 C W2,=X'0000FFFF' 00000134 BE EXMOUNT 00000135 IFREG W2,Z,NEXTUCB 00000136 CLIB UCBID-UCB(W2),X'FF',NE,NEXTUCB 00000137 TMB UCBTBYT3-UCB(W2),UCB3DACC+UCB3TAPE,Z,NEXTUCB 00000138 CLCB UCBVOLI-UCB(6,W2),VOLSER,E,NOMOUNT 00000139 NEXTUCB LA W1,2(W1) 00000140 B UCBLOOP 00000141 * 00000142 NOMOUNT #WTO 4 00000143 B MWAIT 00000144 SPACE 2 00000145 *********************************************************************** 00000146 * READ PRESRES * 00000147 *********************************************************************** 00000148 EXMOUNT DS 0H 00000149 FILL PRDATA,C' ' 00000150 MVC PRDATA(6),VOLSER 00000151 LA 1,PRDATA+6 00000152 CLI 0(1),C' ' 00000153 BNE *+8 00000154 BCT 1,*-8 00000155 MVI 1(1),C',' 00000156 LA 0,PRDATA-2 00000157 SR 1,0 R1 - LENGTH OF VOLSER + 1 (COMMA) 00000158 STH 1,CCWP4+6 STORE LENGTH IN CCW 00000159 * 00000160 TMB DCBP+48,X'10',Z,EXMOUNT1 - DCB NOT OPENED 00000161 EXCP IOBP 00000162 WAIT ECB=ECBP 00000163 CLIB ECBP,X'7F',E,EXMOUNT1 - RECORD FOUND 00000164 CLIB IOBP+12,X'0D',E,EXMOUNT1 - NO RECORD FOR THIS VOLUME 00000165 * 00000166 #WTO 10 00000167 SPACE 2 00000168 *********************************************************************** 00000169 * CALL MOUNT EXECUTOR * 00000170 *********************************************************************** 00000171 EXMOUNT1 LR 0,RUCB 00000172 LA 1,READAREA 00000173 L 15,=V(IEEAVM02) 00000174 IFREG 15,Z,EXMOUNT2 00000175 BALR 14,15 00000176 B MOUNTWTO 00000177 * 00000178 EXMOUNT2 LINK EP=IEEAVM02 00000179 * 00000180 MOUNTWTO IFREG 15,NZ,NOMOUNT 00000181 * 00000182 MVC STABC,=C'PRIV' 00000183 TMB UCBSTAB,X'10',O,MNTWTO0 00000184 MVC STABC,=C' PUB' 00000185 TMB UCBSTAB,X'08',O,MNTWTO0 00000186 MVC STABC,=C'STRG' 00000187 TMB UCBSTAB,X'04',O,MNTWTO0 00000188 MVC STABC,=C' ' 00000189 * 00000190 MNTWTO0 TMB SAVESTAT,UCBONLI,Z,MNTWTO2 00000191 #WTO 3 00000192 B MNTWTO3 00000193 MNTWTO2 #WTO 2 00000194 B MNTWTO3 00000195 * 00000196 MNTWTO3 DS 0H 00000197 LA W1,PRDATA+18 00000198 LA W2,PRDATA+71 00000199 MNTWTO31 CLIB 0(W1),C' ',NE,MNTWTO32 00000200 LA W1,1(W1) 00000201 CRB W1,W2,NL,MWAIT 00000202 B MNTWTO31 00000203 MNTWTO32 CLIB 0(W1),C'.',E,MWAIT IF 1-ST CHAR. IS DOT - NO MESSAGE 00000204 MNTWTO33 CLIB 0(W2),C' ',NE,*+8 00000205 BCT W2,MNTWTO33 00000206 * 00000207 BCTR W1,0 00000208 SR W2,W1 00000209 STC W2,0(W1) 00000210 #WTO 6 00000211 B MWAIT 00000212 SPACE 2 00000213 *********************************************************************** 00000214 * WTO SUBROUTINE * 00000215 *********************************************************************** 00000216 #WTO DS 0H 00000217 BUILDMSG BUF=MSGBUF,TAB=MSGTAB,NUM=(0),TC=(CALL,BLDMSGA) 00000218 STH 0,MSGBUF+4 00000219 MVI MSGBUF+6,X'80' 00000220 WTO MF=(E,MSGBUF+4) 00000221 BR 10 00000222 SPACE 2 00000223 *********************************************************************** 00000224 * CONSTANTS AND WORK AREAS * 00000225 *********************************************************************** 00000226 DCB DCB DDNAME=IEFPDSI,MACRF=E,IMSK=X,IOBAD=IOB,EXLST=EXLST 00000227 IOB IOB DCB=DCB,ECB=ECB,SEEK=0,START=CCW1 00000228 ECB DC F'0' 00000229 * 00000230 DCBP DCB DDNAME=IEFPDSI,MACRF=E,IOBAD=IOBP,EXLST=EXLST 00000231 IOBP IOB DCB=DCBP,ECB=ECBP,SEEK=0,START=CCWP1 00000232 ECBP DC F'0' 00000233 * 00000234 OPENL OPEN DCB,MF=L 00000235 EXLST DC X'87',AL3(JFCB) 00000236 ENABLE MODESET ENABLE=YES,MF=L 00000237 DISABLE MODESET ENABLE=NO,MF=L 00000238 BLDMSGA DC F'0' 00000239 VOL1 DC C'VOL1' 00000240 * 00000241 CCW1 CCW X'29',VOL1,CC+SLI,4 00000242 CCW 8,*-8,0,0 00000243 CCW X'06',READAREA,0,80 00000244 * 00000245 CCWP1 CCW X'31',IOBP+35,CC,5 00000246 CCW 8,*-8,0,0 00000247 CCW X'92',RCNT,CC,8 00000248 CCWP4 CCW X'AD',PRDATA,CC+SLI,7 00000249 CCW 8,*-16,0,0 00000250 CCW X'16',0,CC+SLI+SKP,1 00000251 CCW X'31',RCNT,CC,5 00000252 CCW 8,*-8,0,0 00000253 CCW X'06',PRDATA,SLI,L'PRDATA 00000254 * 00000255 JFCB DC 44X'04',8C' ',X'08',65X'0',30C' ',26X'0',X'0100' 00000256 ORG JFCB 00000257 READAREA DS XL80 00000258 VOLSER EQU READAREA+4,6 00000259 VTOCADR EQU READAREA+11,5 00000260 * 00000261 VTOCTTR DS F 00000262 * 00000263 PRDATA DS CL72 AREA TO READ RECORD FROM PRESRES 00000264 RCNT EQU PRDATA+10 00000265 * 00000266 MSGBUF DS 10D .? 00000267 CCHHR EQU MSGBUF,8 00000268 * 00000269 SAVESTAT DS C 00000270 STABC DS CL4 00000271 SPACE 2 00000272 MSGTAB MSGTAB ('I/O ERROR',+S,'READING LABEL'), 1 +00000273 ('MOUNTED',('VOL=',,,S),VOLSER,' - ',STABC,'/RSERV'), 2 +00000274 ('NEW VOLUME ',), 3 +00000275 ('VOL=',VOLSER,+S,'CANNOT BE','MOUNTED'), 4 +00000276 ('IS OFFLINE'), 5 +00000277 ((0(W1),*40)), 6 +00000278 ,,, 7-9 +00000279 ('I/O ERROR',+S,'IN PRESRES'), 10 +00000280 PREFIX=('AVM',*,'I ',UCBNAME,' '), +00000281 TAIL=(X'00005000'), ROUT=(2,4) +00000282 FIRST=1,MAXLEN=72 00000283 SPACE 2 00000284 LTORG 00000285 EJECT 00000286 *********************************************************************** 00000287 * MOUNT SUBROUTINE * 00000288 *********************************************************************** 00000289 IEEAVM02 CSECT 00000290 USING IEEAVM02,15 00000291 USING READAREA,1 00000292 SAVE (14,12) 00000293 LR RUCB,0 00000294 * 00000295 MVC UCBVOLI,VOLSER MOVE VOLUME SERIAL TO UCB 00000296 MVC UCBVTOC,VTOCTTR MOVE VTOC ADDRESS TO UCB 00000297 * 00000298 LA 2,PRDATA+1 00000299 LA 0,6 00000300 CLIB 0(2),C',',E,*+12 00000301 LA 2,1(2) 00000302 BCT 0,*-12 00000303 LA 2,3(2) R2 POINTS TO CHARACTER: 0 - STORAGE, 00000304 * 1 - PUBLIC, 2 - PRIVATE 00000305 CLIB 0(2),C'0',E,STORAGE 00000306 CLIB 0(2),C'1',E,PUBLIC 00000307 * ELSE - PRIVATE 00000308 MVI UCBSTAB,X'10' - BIT 'PRIVATE' 00000309 B SETSTAT 00000310 PUBLIC MVI UCBSTAB,X'08' - BIT 'PUBLIC' 00000311 B SETSTAT 00000312 STORAGE MVI UCBSTAB,X'04' - BIT 'STORAGE' 00000313 B SETSTAT 00000314 * 00000315 SETSTAT MVI UCBSTAT,X'A0' BITS ONLINE,RESERVED 00000316 * 00000317 RETURN (14,12),RC=0 00000318 DROP 15 00000319 DROP 1 00000320 SPACE 2 00000321 COPY CCWEQU 00000322 END 00000323 * 00000324 * 00000325 * 00000326 * 00000327 * 00000328 * 00000329 * 00000330 * 00000331 * 00000332 * 00000333 * 00000334 * 00000335 * 00000336 * 00000337 * 00000338 * 00000339 * 00000340 * 00000341 * 00000342 * 00000343 * 00000344 * 00000345 * 00000346 * 00000347 * 00000348 * 00000349 * 00000350 * 00000351