/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : ALIKE */ /* */ /* Description : Create a dataset with the same attributes as the */ /* one displayed on the 3.4 panel, or passed as a */ /* parameter. */ /* */ /* Created on : 14 May 2018 */ /* Created by : KEVIN FERGUSON */ /* : Userid(MIT001) */ /* : using ABBYDALE.XFER.REXX(ALIKE) */ /* */ /* Called by : */ /* */ /* Calls : */ /* */ /* Change Activity : */ /* */ /* MM/DD/YYYY ID Comment */ /* --------------------------------------------------------------- */ /* 10/20/2023 FIX Fixed the issue when no answer is given for */ /* new volume definition. */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ signal on halt /* attention key */ parse upper arg dsn vol dsn = strip(dsn,b,"'") s = userid() new = dsn do while new = dsn say 'Enter new name' pull new iterate end DSN_STATUS = LISTDSI(''''dsn'''' smsinfo) volume = sysvolume block = sysblksize do until done = 'Y' say 'Allocate to a new volume? (Y or N)' pull ans SELECT when ans = 'Y' then do say 'Enter target volume' pull volume if LENGTH(volume) = '6' then do done = 'Y' end end when ans = 'N' then do done = 'Y' otherwise nop /*FIX*/ end end say new 'will be allocated on' volume TrapON=OutTrap('ON') "ALLOC F(DATAOUT) DATASET('"new"')" , "SHR VOL("volume") UNIT("sysunit") REUS" , "BLKSIZE("block")" trace 0 if kf = 0 then do say new "already exists on" vol ". Do you want to overwrite it?" pull ans if ans <> "Y" then exit end else do If sysstorclass = '' then do "ALLOC F(DATAOUT) DATASET('"new"') NEW CATALOG VOL("volume")" , "UNIT(3390) LIKE('"dsn"') REUS" , "BLKSIZE("block")" end else do say dsn ' is SMS Managed' TrapON=OutTrap('OFF') "ALLOC F(DATAOUT) DATASET('"new"') NEW CATALOG" , " LIKE('"dsn"') REUS", " STORCLAS("sysstorclass")" /* " MGMTCLAS("sysmgmtclass")" , " DATACLAS("sysdataclass")" */ end end "free f(DATAOUT)" exit /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of ALIKE */ /*-------------------------------------------------------------------*/