<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Operators in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100088#M28099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;where category variable has :&lt;/P&gt;&lt;P&gt;in&lt;/P&gt;&lt;P&gt;out&lt;/P&gt;&lt;P&gt;middle&lt;/P&gt;&lt;P&gt;Are these both notations correct to select all the value starting with &lt;STRONG&gt;in&lt;/STRONG&gt;???&lt;BR /&gt;if category &lt;STRONG&gt;eq:&lt;/STRONG&gt; "in" then....&lt;/P&gt;&lt;P&gt;if category eq &lt;STRONG&gt;"in:" then....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jun 2013 20:25:52 GMT</pubDate>
    <dc:creator>robertrao</dc:creator>
    <dc:date>2013-06-07T20:25:52Z</dc:date>
    <item>
      <title>Operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100088#M28099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;where category variable has :&lt;/P&gt;&lt;P&gt;in&lt;/P&gt;&lt;P&gt;out&lt;/P&gt;&lt;P&gt;middle&lt;/P&gt;&lt;P&gt;Are these both notations correct to select all the value starting with &lt;STRONG&gt;in&lt;/STRONG&gt;???&lt;BR /&gt;if category &lt;STRONG&gt;eq:&lt;/STRONG&gt; "in" then....&lt;/P&gt;&lt;P&gt;if category eq &lt;STRONG&gt;"in:" then....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 20:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100088#M28099</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-06-07T20:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: Operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100089#M28100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The colon is a modifier on the comparison operator, not on the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if category &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;eq:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; "in" then ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;If you are using WHERE instead of IF then you could use LIKE operator:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;where category like 'in%' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 20:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100089#M28100</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-07T20:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100090#M28101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i was confused because we use colon operator beisde variable name to pick the variable names starting with the specified&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we have variables var1 to var50&lt;/P&gt;&lt;P&gt;we can just write for example( keep =&lt;STRONG&gt;var:)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;how is this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if category &lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;eq:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; "in" then ... different from the above????&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 21:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100090#M28101</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-06-07T21:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Operators</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100091#M28102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Take a look at this: &lt;A href="http://support.sas.com/kb/24/851.html" title="http://support.sas.com/kb/24/851.html"&gt;24851 - Using a Colon Modifier to Select Observations with Values Beginning with a Specific Character By Kirk Paul Lafler&lt;/A&gt; or from the doc (&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p00iah2thp63bmn1lt20esag14lh.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p00iah2thp63bmn1lt20esag14lh.htm"&gt;SAS(R) 9.3 Language Reference: Concepts, Second Edition&lt;/A&gt;) "You can add a colon (:) modifier to any of the operators to compare only a specified prefix of a character string."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or, you can write a program to prove to yourself how the different syntax elements would work.&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data colon_mod;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; infile datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; input string $;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; test1 = 'n';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; test2 = 'n';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; test3 = 'n';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; if string =: 'in' then test1 = 'y';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; if string =&amp;nbsp; 'in' then test2 = 'y';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; if string = 'in:' then test3 = 'y';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;return;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;inert&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;input&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;in&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;inagadda&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;nothing&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=colon_mod;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 23:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Operators/m-p/100091#M28102</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-06-07T23:10:30Z</dc:date>
    </item>
  </channel>
</rss>

