<?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 Re: sql in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16082#M2890</link>
    <description>Hi:&lt;BR /&gt;
  I believe you are getting that message because you do not have a space:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if cod=('21'and '31');&lt;BR /&gt;
           --&lt;BR /&gt;
[/pre]&lt;BR /&gt;
between the ' and the 'a' for &lt;B&gt;and&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
However, it is probably a moot point, since the syntax of your IF statement is incorrect. For some examples of how to code an IF statement, refer to the documentation examples found here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201978.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201978.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
For one thing, it would be impossible for 1 variable to hold 2 values on a single observation so you would never find an observation where the value for COD was both '21' AND '31'. So I suspect you want to subset those observations where the value for code is &lt;B&gt;either&lt;/B&gt; '21' &lt;B&gt;or&lt;/B&gt; is '31'. &lt;BR /&gt;
&lt;BR /&gt;
You could use either of these forms of subsetting IF:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if cod='21' or cod='31';&lt;BR /&gt;
OR&lt;BR /&gt;
if cod in ('21', '31');&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Wed, 23 Feb 2011 20:26:23 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-02-23T20:26:23Z</dc:date>
    <item>
      <title>sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16081#M2889</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am getting an error on this below code:&lt;BR /&gt;
&lt;BR /&gt;
data svc(keep=aaa ddd);&lt;BR /&gt;
 set &amp;amp;libn1..svcs;&lt;BR /&gt;
 if cod=('21'and '31');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Error:&lt;BR /&gt;
NOTE 49-169: The meaning of an identifier after a quoted string may change in a future SAS release.  Inserting white space between a quoted string and the succeeding identifier is recommended.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;BR /&gt;
Raj</description>
      <pubDate>Wed, 23 Feb 2011 20:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16081#M2889</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-23T20:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16082#M2890</link>
      <description>Hi:&lt;BR /&gt;
  I believe you are getting that message because you do not have a space:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if cod=('21'and '31');&lt;BR /&gt;
           --&lt;BR /&gt;
[/pre]&lt;BR /&gt;
between the ' and the 'a' for &lt;B&gt;and&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
However, it is probably a moot point, since the syntax of your IF statement is incorrect. For some examples of how to code an IF statement, refer to the documentation examples found here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201978.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201978.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
For one thing, it would be impossible for 1 variable to hold 2 values on a single observation so you would never find an observation where the value for COD was both '21' AND '31'. So I suspect you want to subset those observations where the value for code is &lt;B&gt;either&lt;/B&gt; '21' &lt;B&gt;or&lt;/B&gt; is '31'. &lt;BR /&gt;
&lt;BR /&gt;
You could use either of these forms of subsetting IF:&lt;BR /&gt;
[pre]&lt;BR /&gt;
if cod='21' or cod='31';&lt;BR /&gt;
OR&lt;BR /&gt;
if cod in ('21', '31');&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 23 Feb 2011 20:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16082#M2890</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-23T20:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: sql</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16083#M2891</link>
      <description>Thanks Cynthia !!!&lt;BR /&gt;
&lt;BR /&gt;
It works out !!</description>
      <pubDate>Wed, 23 Feb 2011 20:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sql/m-p/16083#M2891</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-23T20:29:48Z</dc:date>
    </item>
  </channel>
</rss>

