On 12 Mar 2008 17:52:58 -0700, in bit.listserv.ibm-main (Message-ID:<[EMAIL PROTECTED]>) [EMAIL PROTECTED] (Paul Gilmartin) wrote:

Ages ago, before TSO/IDCAMS was so nearly smart, I coded in
Rexx (IIRC):

   address 'TSO'
   'HDELETE ''DATA.SET.NAME'' WAIT'
   if RC<>0 then
       'DELETE ''DATA.SET.NAME'''

Crude, but effective.

Mine was more complex, but I don't know if it was more effective. There will probably be line-wrap problems. "sysreasn" is an external REXX routine that returns the text of LISTDSI reason codes. The first section is my standard entry code to allow me to specify variables on the command line.

/*  REXX exec to delete datasets without hrecall  */

arg dsn temp1

do while temp1 \= ''
  parse var temp1 temp2 temp1
  if right(temp2,1) = ')' then
    temp2 = translate(temp2,'= ','()')
  if pos('=',temp2) = 0 then temp2 = temp2 || '= ""'
  interpret temp2
end
drop temp1
drop temp2
if debug = 'TRACE' then trace ?i
else if debug \= "DEBUG" then trace i

if wait= 'WAIT' then dowait = '' /* wait for hsm to delete? */
else dowait = 'WAIT'

temp = listdsi(dsn "NORECALL")
select
  when temp = 0 then
    "DELETE" dsn
  when temp = 16 then
    if sysreason = 9 then "HDELETE" dsn dowait
    else
      if quiet = "QUIET" then do
        call sysreasn sysreason
say dsn "cannot be deleted this way because" result
        if sysreason \= 5 then
          "LISTC ALL ENT("dsn
      end
  otherwise
    if quiet = "QUIET" then do
      say dsn "cannot be deleted this way"
      "LISTC ALL ENT("dsn
    end
end
exit 0


--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" intergate "dot" com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to