On Wed, 2 Oct 2019, at 10:32, Bill Giannelli wrote:
> I have the following rexx command:
> 
> ADDRESS TSO                                       
> 'CALL LISTDSI ( dataset.TXT NORECALL)'             
> ADDRESS TSO                                       
> 'IF SYSREASON = 9  THEN "HDELETE  dataset.TXT WAIT"
> ELSE "DELETE  dataset.TXT"'   

a) you don't need the second "address tso" because the first one sets
the environment to which all commands will be directed, and you've
not changed it since using it.

b) a better way to use listdsi is by

   lrc = listdsi(thedsn "NORECALL")

where   thedsn   has been given the appropriate value first.   Note that 
the "NORECALL" literal is in quotes, else you risk a variable named 
NORECALL being used instead.  Yes, such a variable if not defined will
default to the same value, but it's better to put literals in quotes.

You need to check the rc from listdsi   (here returned to  lrc)  before you 
look at sysreason.

c) your 'if ....'  line is not a rexx statement, but instead a command.  You 
  have sent the whole string to TSO.   

You need to read a TSO programming manual.  Your code is so full of 
mistakes that you're going to confuse yourself terribly at this rate.

 
-- 
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to