<?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 error in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15143#M2607</link>
    <description>You are mixing the data step and proc sql code.  When using "data testout; set test..." you cannot use the proc sql type statements (select from, left join, etc.).</description>
    <pubDate>Tue, 22 Feb 2011 19:17:50 GMT</pubDate>
    <dc:creator>RickM</dc:creator>
    <dc:date>2011-02-22T19:17:50Z</dc:date>
    <item>
      <title>sql error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15142#M2606</link>
      <description>Hi Friends,&lt;BR /&gt;
&lt;BR /&gt;
I am new to SAS programming..I am getting an error on the below code..&lt;BR /&gt;
&lt;BR /&gt;
PROC IMPORT OUT = types&lt;BR /&gt;
       DATAFILE= "&amp;amp;drv2\types.CSV" &lt;BR /&gt;
        REPLACE;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
data testout;&lt;BR /&gt;
set test;&lt;BR /&gt;
&lt;B&gt;if (expdat&amp;gt;today() or expdat=.) and stat ='IN'&lt;BR /&gt;
and (typ in (Select typ from types));&lt;/B&gt;keep lobcod typ;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Error:&lt;BR /&gt;
(typ in (Select typ from types));&lt;BR /&gt;
            ------&lt;BR /&gt;
                         22&lt;BR /&gt;
                         76&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: a quoted string,&lt;BR /&gt;
             a numeric constant, a datetime constant, a missing value,&lt;BR /&gt;
iterator, (.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
Please help me to resolve this issue.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;BR /&gt;
Raj</description>
      <pubDate>Tue, 22 Feb 2011 18:59:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15142#M2606</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-22T18:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: sql error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15143#M2607</link>
      <description>You are mixing the data step and proc sql code.  When using "data testout; set test..." you cannot use the proc sql type statements (select from, left join, etc.).</description>
      <pubDate>Tue, 22 Feb 2011 19:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15143#M2607</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-02-22T19:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: sql error</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15144#M2608</link>
      <description>Just use proc sql instead of the data step.  [pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
	create table testout as&lt;BR /&gt;
	select lobcod, typ&lt;BR /&gt;
	from test&lt;BR /&gt;
	where (expdat&amp;gt;today() or expdat=.) and stat ='IN'&lt;BR /&gt;
		and (typ in (Select typ from types));&lt;BR /&gt;
quit;[/pre]</description>
      <pubDate>Tue, 22 Feb 2011 19:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sql-error/m-p/15144#M2608</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2011-02-22T19:56:49Z</dc:date>
    </item>
  </channel>
</rss>

