It must be a slow day in Bedrock.
I was looking at this and realized that there may be a flaw.
As it is written it doesn't matter what the 'ANSWER' is as long as it starts 
with a 'Y' it will be true.
A response of YABADABADOO would pass the test.
My guess is what you really want is that ONLY 'Y' and 'YES' should be valid.
In that case take the SUBSTR(ANSWER,1,1) out and just use ANSWER..
i.e.  IF ANSWER ¬= 'Y' & ANSWER ¬= 'YES' THEN


-----Original Message-----
From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED] Behalf Of Huegel, 
Thomas
Sent: Monday, July 07, 2008 11:32 AM
To: [email protected]
Subject: Re: REXX coding question.


Try it this way:

IF SUBSTR(ANSWER,1,1) ¬= 'Y' & ANSWER ¬= 'YES' THEN


-----Original Message-----
From: The IBM z/VM Operating System [mailto:[EMAIL PROTECTED] Behalf Of Howard 
Rifkind
Sent: Monday, July 07, 2008 11:24 AM
To: [email protected]
Subject: REXX coding question.


This is confusing me.

The response to the variable 'answer' is a Y.

Yet this portion of the code isn't working.  Shouldn't the logic just fall thru 
because the response was a Y.

IF SUBSTR(ANSWER,1,1) /= 'Y' | ANSWER /= 'YES' THEN
   DO
     SAY ANSWER
     SAY 'THE WRONG RESPONSE HAS BEEN ENTERED'
     SAY
     SAY 'PROCEDURE IS TERMINATING, PLEASE TRY AGAIN'
     EXIT
   END


Thanks



_____________
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential
and may be privileged. It is intended for the addressee(s) only.
Access to this E-mail by anyone else is unauthorized.
If you are not an addressee, any disclosure or copying of the
contents of this E-mail or any action taken (or not taken) in
reliance on it is unauthorized and may be unlawful. If you are not an
addressee, please inform the sender immediately, then delete this
message and empty from your trash.
        

Reply via email to