tag:blogger.com,1999:blog-10629375.post2253299090661578074..comments2024-03-28T02:21:23.122-07:00Comments on Data Steps: != does not == neStephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-10629375.post-4151083228738464792011-02-19T12:06:22.838-08:002011-02-19T12:06:22.838-08:00or ~=or ~=Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-10629375.post-90873811731977832022011-02-10T19:40:00.594-08:002011-02-10T19:40:00.594-08:00Just use ^= in SAS for not equals.Just use ^= in SAS for not equals.Gerad Pnoreply@blogger.comtag:blogger.com,1999:blog-10629375.post-33676300425566737132010-11-16T11:42:46.078-08:002010-11-16T11:42:46.078-08:00@Chris!
Oh no, the <> operator is not a &qu...@Chris!<br /><br />Oh no, the <> operator is not a "not equals" operator in SAS. It is a max operator, as in compare the values on both sides and return the max value. So if it is used in an "if" statement it will ALWAYS evaluate as true (unless you are comparing two missings, two zeroes, or a missing and a zero).<br /><br />Try out <br />data _null_;<br /> if 4 <&Stephenhttps://www.blogger.com/profile/01356803756509162192noreply@blogger.comtag:blogger.com,1999:blog-10629375.post-24504034685695379912010-11-16T10:26:25.703-08:002010-11-16T10:26:25.703-08:00As a C# and SAS programmer, that one gets me all o...As a C# and SAS programmer, that one gets me all of the time. For "not equals" in SAS, I like the <> operator. Reminds me of Pascal in CIS 101.Chris Hemedingerhttps://www.blogger.com/profile/02135675689987752160noreply@blogger.comtag:blogger.com,1999:blog-10629375.post-36755415084503761582010-11-16T08:03:29.520-08:002010-11-16T08:03:29.520-08:00What is happening is that SAS is testing "&am...What is happening is that SAS is testing "&name !" to "Stephen". You can validate this behavior with adding " !" after Stephen. I suspect this has to do with how SAS parses the if syntax in the Macro compiler. Also, there is not a == operator as the title may suggest. Valid operators can be found at the below link.<br /><br />http://support.sas.com/Anonymousnoreply@blogger.com