Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Rexx not equals operator

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 33

PostPosted: Sat Sep 20, 2014 2:57 am    Post subject: Rexx not equals operator
Reply with quote

Can 'not equals' be represented by /= in Rexx ?
The manual only mentions \=
However I accidentally coded /= instead and it seems to work the same as \=
But if I use / by itself for negating a condition, I get an error
Could a rexx guru please explain to me what might be going on ?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Sat Sep 20, 2014 3:28 am    Post subject: Reply to: Rexx not equals operator
Reply with quote

the \= is NOT a logical negation of the = operator is an operator itself like the ** ( power ) operator.
that' s all

the char to be used for the NOT logical operator is a bit murky ...

what You see depends on the the terminal code page used

and the behaviour could be different on the pc

see for example ( open object rexx on a mac book pro )
Code:

#!/usr/bin/rexx

a = 0

b = 1

if a then ,
   say " a is true"

if b then ,
   say " b is true"


if a \= b then ,
   say "a \= b"

if a = \b then ,
   say "a = \b"



and the result is

Code:

 b is true
a \= b
a = \b

Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 33

PostPosted: Sat Sep 20, 2014 4:20 am    Post subject:
Reply with quote

But what about /= ? with a forward slash
It is not documented in the manual
Is / somehow being interpreted as the division operator ?
why is it behaving exactly like \=
I see other instances where /= is being used in production as well and behaves the same way.
Please tell me I am not crazy.
I beleive I am veiwing the code using IBM-1047 Rumba setting.
Host os is z/OS

Code:
000007 /* REXX */                                                             
       654DCEE45644444444444444444444444444444444444444444444444444444444444444
       1C095770C100000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000008 var1='n'                                                               
       A89F77974444444444444444444444444444444444444444444444444444444444444444
       5191ED5D0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000009 if var1 = 'y' then say 'y'                                             
       884A89F4747A74A8894A8A47A74444444444444444444444444444444444444444444444
       96051910E0D8D0385502180D8D0000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000010 if var1 /= 'y' then say 'n'                                             
       884A89F46747A74A8894A8A4797444444444444444444444444444444444444444444444
       960519101E0D8D0385502180D5D000000000000000000000000000000000000000000000


gives
Code:
n



Code:
 000007 /* REXX */                                                             
       654DCEE45644444444444444444444444444444444444444444444444444444444444444
       1C095770C100000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000008 var1='n'                                                               
       A89F77974444444444444444444444444444444444444444444444444444444444444444
       5191ED5D0000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000009 if var1 = 'y' then say 'y'                                             
       884A89F4747A74A8894A8A47A74444444444444444444444444444444444444444444444
       96051910E0D8D0385502180D8D0000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000010 if var1 \= 'y' then say 'n'                                             
       884A89F4E747A74A8894A8A4797444444444444444444444444444444444444444444444
       960519100E0D8D0385502180D5D000000000000000000000000000000000000000000000


gives:
Code:
n
too !!!

I have turned on hex to show the hex representation of the characters that I am using. As you can see I am sseing x'61' as / and x'e0' as \
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Sat Sep 20, 2014 10:08 am    Post subject: Reply to: Rexx not equals operator
Reply with quote

see here
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A370/2.2.2.3?SHELF=IKJ4BK90&DT=20060626210253&CASE=

but as I said before all depends on Your emulator configuration

the same problem exists for
¬ VS ˆ

{}[]

| VS !
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 587
Location: The Universe

PostPosted: Sat Sep 20, 2014 10:46 am    Post subject:
Reply with quote

TSO/E REXX Reference shows ¬=, /= and \= as not equal.
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 33

PostPosted: Sat Sep 20, 2014 5:39 pm    Post subject:
Reply with quote

Thank you so much
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us