//PDSLOAD JOB (1),'RELOAD REXX',CLASS=A,MSGCLASS=X //* //PDSLOAD EXEC PGM=PDSLOAD,PARM='NEW' //SYSPRINT DD SYSOUT=* //SYSUT2 DD DISP=SHR,DSN=SYS2.EXEC <-- TARGET //SYSIN DD DATA,DLM='><' ./ ADD NAME=DASDONL /* REXX Script: DASDONL Purpose: Verify DASD volume specified is online Author: Jay Moseley Step through Unit Control Block table and verify that the volume serial number passed is currently online. */ IF ARG() \= 1 THEN DO SAY 'Volume Serial Number not specified'; RETURN -1; END; cvt = C2D(STORAGE(D2X(16),4)); /* load address of CVT */ ucbtab = C2D(STORAGE(D2X(cvt+40),4)); /* load address of UCB table */ ix = 0; /* index for stem variables to receive information */ DO unitnbr = 1 BY 1 /* sequentially process entries in UCB table */ /* load address of Unit Control Block */ ucbaddr = C2D(STORAGE(D2X(ucbtab+((unitnbr-1)*2)),2)) IF ucbaddr == 65535 THEN LEAVE; /* end of table is x'FFFF' */ /* if address is not zero, and it is a normal UCB entry, and it is a Direct Access device, and it is online, compare to ARG() */ IF ucbaddr \= 0 THEN DO ucbdata = STORAGE(D2X(ucbaddr),35); IF BITAND(SUBSTR(ucbdata,3,1), 'FF'x) == 'FF'x THEN IF BITAND(SUBSTR(ucbdata,19,1), '20'x) == '20'x THEN IF BITAND(SUBSTR(ucbdata,4,1), '80'x) == '80'x THEN IF SUBSTR(ucbdata,29,6) == UPPER(ARG(1)) THEN RETURN 0; END; END; /* Requested Volume Serial not found */ RETURN -1; ./ ENDUP >< /* //