<?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 WHERE in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/WHERE-in-SAS/m-p/69025#M19778</link>
    <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I use:-&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data exam;&lt;BR /&gt;
input name $ class $ score ;&lt;BR /&gt;
cards;&lt;BR /&gt;
Tim math 9&lt;BR /&gt;
Tim history 8&lt;BR /&gt;
Tim science 7&lt;BR /&gt;
Sally math 10&lt;BR /&gt;
Sally science 7;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data student1;&lt;BR /&gt;
set exam;&lt;BR /&gt;
where name = ‘Tim’ or name = ‘Sally’; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I get error:&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Syntax error while parsing WHERE clause.&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;
              a numeric constant, a datetime constant, a missing value, (, *, +, -, :, INPUT, NOT,&lt;BR /&gt;
              PUT, ^, ~.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Kindly guide.&lt;BR /&gt;
K.</description>
    <pubDate>Fri, 04 Feb 2011 01:54:10 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-02-04T01:54:10Z</dc:date>
    <item>
      <title>WHERE in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WHERE-in-SAS/m-p/69025#M19778</link>
      <description>Hi All,&lt;BR /&gt;
&lt;BR /&gt;
I use:-&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data exam;&lt;BR /&gt;
input name $ class $ score ;&lt;BR /&gt;
cards;&lt;BR /&gt;
Tim math 9&lt;BR /&gt;
Tim history 8&lt;BR /&gt;
Tim science 7&lt;BR /&gt;
Sally math 10&lt;BR /&gt;
Sally science 7;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data student1;&lt;BR /&gt;
set exam;&lt;BR /&gt;
where name = ‘Tim’ or name = ‘Sally’; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I get error:&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Syntax error while parsing WHERE clause.&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;
              a numeric constant, a datetime constant, a missing value, (, *, +, -, :, INPUT, NOT,&lt;BR /&gt;
              PUT, ^, ~.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Kindly guide.&lt;BR /&gt;
K.</description>
      <pubDate>Fri, 04 Feb 2011 01:54:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WHERE-in-SAS/m-p/69025#M19778</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-04T01:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/WHERE-in-SAS/m-p/69026#M19779</link>
      <description>Hi:&lt;BR /&gt;
  I can duplicate your error message if I cut and paste code from Microsoft Word that uses "slanted" quotes instead of "regular" quotes. For example:&lt;BR /&gt;
[pre]&lt;BR /&gt;
142  where name = ‘Tim’ or name = ‘Sally’;&lt;BR /&gt;
                  -&lt;BR /&gt;
                  22&lt;BR /&gt;
                  76&lt;BR /&gt;
ERROR: Syntax error while parsing WHERE clause.&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,&lt;BR /&gt;
              a numeric constant, a datetime constant, a missing value, (, *, +, -, :,&lt;BR /&gt;
              INPUT, NOT, PUT, ^, ~.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
                     &lt;BR /&gt;
143  run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                       &lt;BR /&gt;
Notice the "slanted" quote marks. If, on the other hand, I type in Notepad or in SAS Display Manager or use the "unslanted" quotes, the WHERE statement does not generate an error message:&lt;BR /&gt;
[pre]&lt;BR /&gt;
158  where name = 'Tim' or name = 'Sally';&lt;BR /&gt;
159  run;&lt;BR /&gt;
                                     &lt;BR /&gt;
NOTE: There were 5 observations read from the data set WORK.EXAM.&lt;BR /&gt;
      WHERE name in ('Sally', 'Tim');&lt;BR /&gt;
NOTE: The data set WORK.STUDENT1 has 5 observations and 3 variables.&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                   &lt;BR /&gt;
   Perhaps if you try retyping your WHERE clause and ensure that there are no "slanted" quotes, you will have success.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 04 Feb 2011 05:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/WHERE-in-SAS/m-p/69026#M19779</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-04T05:25:00Z</dc:date>
    </item>
  </channel>
</rss>

