Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 10203
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: 10203
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 User


Joined: 30 Nov 2013
Posts: 462
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us