/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : LISTVOLS */ /* */ /* Description : List all online DASD Volumes and unit addresses */ /* */ /* Note : This EXEC should work on z/OS systems from Z/OS 1.7 */ /* ------ */ /* onwards. Additonal information could be obtained from */ /* the UCBs iy you need to display it (ie Unit type etc). */ /* */ /* Created on : 5 Sep 2022 */ /* Created by : Kevin Ferguson */ /* : Userid MIT001 */ /* : Using ABBYDALE.PROD.REXX(LISTVOLS) */ /* */ /* Called by : VTOCCHK */ /* */ /* Calls : Nothing */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Parse Arg Help /* Check for Help */ If SYSVAR("SYSISPF")<>"ACTIVE" then do Say "ISPF must be active to use "LISTVOLS exit(16) end If Help = "?" Then do Call Disp_Help exit(4) end signal on halt /* attention key */ Numeric Digits 10 /* Set sensitivity */ VolCount = 0 /* Volume count */ cvt_ptr = get_ptr(10,) /* CVT Pointer */ IOCOM= get_ptr(cvt_ptr,'7C') /* IOCOM Pointer */ IOVT = get_ptr(IOCOM,'D0') /* IOVT Pointer */ ULUT = get_ptr(IOVT,'8') /* ULUT Pointer */ SysType = Calc_Address(ULUT '+' 4) /* Get system level */ SysType = get_it(HDATA SysType ,1) /* Make it usable */ Select when Systype = 1 then do /* Type 1 ULUT */ loop = Calc_Address(ULUT '+' 10) /* Loop Counter */ UCTAB = get_ptr(ULUT, '10') /* UCB Table */ end when Systype = 2 then do /* Type 2 ULUT */ loop = Calc_Address(ULUT '+' 18) /* Loop Counter */ UCTAB = get_ptr(ULUT, '14') /* UCB Table */ end otherwise /* Type 3 ULUT */ loop = Calc_Address(ULUT '+' 1C) /* Loop Counter */ UCTAB = get_ptr(ULUT, '1C') /* UCB Table */ end Loop = x2d(get_it(HDATA loop 4)) /* Get loop counter */ do until loop = 0 UCB = get_ptr(UCTAB, 8) /* Point to the UCB */ device = calc_address(UCB '+' 12) /* Find Device type */ device = get_it(HDATA Device 1) /* Get device type */ if device = 20 then do /* Only Porcess DASD Devices */ online = calc_address(UCB '+' 3) /* See if it is online */ online = x2d(get_it(HDATA online 1)) if online > 130 then do /* Only Process Online DASD */ volser = calc_address(UCB '+' 1c) /* Point to VOLSER */ say get_it(HDATA UCTAB 2) get_it(CDATA volser 6) /* say get_it(HDATA UCTAB 2) Display unit */ VolCount = VolCount + 1 /* Increase Volume Count */ end end UCTAB = calc_Address(UCTAB '+' 'c') /* Bubble to next UCB */ loop = loop - 1 /* Decrease Loop Count */ end say "There are" VolCount "online DASD volumes" return /*-------------------------------------------------------------------*/ /* Disp_Help Procedure */ /*-------------------------------------------------------------------*/ Disp_Help: Procedure say "LISTVOLS - Lists the online DASD volumes" say"" say "Usage: LISTVOLS | ?" say"" say" ? - Generates this information." say"" say" Return Codes :" say" 4 - Help displayed" say" 16 - Not under ISPF" say"" Return /*-------------------------------------------------------------------*/ /* End of Disp_Help Procedure */ /*-------------------------------------------------------------------*/ /* get_ptr Subroutine */ /*-------------------------------------------------------------------*/ /* Returns a 4 byte pointer as hexadecimal string at address */ /* ADDR+OFFSET (ADDR and OFFSET must be hex strings.) */ /*-------------------------------------------------------------------*/ get_ptr: procedure arg addr,offset temp=d2x(x2d(addr)+x2d(offset)) return c2x(storage(temp,4)) exit /*-------------------------------------------------------------------*/ /* End of get_ptr Subroutine */ /*-------------------------------------------------------------------*/ /* Calc-Address Procedure */ /*-------------------------------------------------------------------*/ Calc_Address: Procedure arg string parse var string Address Oper Offset /* breakout variables */ Interpret value "= "'D2X( X2D('Address') 'Oper' X2D('Offset') )'"" return value /* and return the value */ /*-------------------------------------------------------------------*/ /* Get_it Procedure */ /*-------------------------------------------------------------------*/ Get_it: Procedure arg string parse var string type address lgth /* breakout variables */ if type = 'ADDR' && type = 'HDATA' then, /* data type ADDR or HEX? */ value = C2X(Storage(address,lgth)) /* Yes - Change it */ else if type = 'DDATA' then, /* Is it decimal data? */ value = C2D(Storage(address,lgth)) /* Yes - Change to decimal*/ else if type = 'BDATA' then, /* is it binary data? */ value = X2B(C2X(Storage(address,lgth))) /* Yes - Change to binary */ else value = Storage(address,lgth) /* No - Just get value */ Return value /* .. and return it */ /*-------------------------------------------------------------------*/ /* get_date Subroutine */ /*-------------------------------------------------------------------*/ /* Returns LENGTH bytes at ADDR+OFFSET as an EBCDIC string. */ /* (ADDR and OFFSET must be hex strings). LENGTH must be a decimal */ /* string. */ /*-------------------------------------------------------------------*/ get_data: procedure arg addr,offset,length temp=d2x(x2d(addr)+x2d(offset)) return storage(temp,length) exit /*-------------------------------------------------------------------*/ /* End of get_data Subroutine */ /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of LISTVOLS */ /*-------------------------------------------------------------------*/