<?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: Proc SQL syntax errors in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583361#M7876</link>
    <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;I understand why I keep seeing the syntax error.&lt;/P&gt;&lt;P&gt;Although I did not get a unique ID though.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2019 23:39:02 GMT</pubDate>
    <dc:creator>oadeyemi</dc:creator>
    <dc:date>2019-08-22T23:39:02Z</dc:date>
    <item>
      <title>Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583353#M7872</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good day everyone.&lt;/P&gt;&lt;P&gt;I am trying to run proc sql command and I am facing some difficulties&lt;/P&gt;&lt;P&gt;Background:&lt;/P&gt;&lt;P&gt;fatal represent numbers per case&lt;/P&gt;&lt;P&gt;countycode represent counties for each fatal.&lt;/P&gt;&lt;P&gt;I intend to generate a table that has unique countycodes and average fatal counts per county.&lt;/P&gt;&lt;P&gt;Below is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select fatals, countycode
	from county 
	group by countycode
	mean (fatals) as fatalcount;
quit; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I keep getting syntax errors.&lt;/P&gt;&lt;P&gt;I will appreciate help with this.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 22:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583353#M7872</guid>
      <dc:creator>oadeyemi</dc:creator>
      <dc:date>2019-08-22T22:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583355#M7873</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select fatals, countycode, mean (fatals) as fatalcount
	from county 
	group by countycode;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Aug 2019 22:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583355#M7873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-08-22T22:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583356#M7874</link>
      <description>&lt;P&gt;FYI - the majority of SQL is the same across all languages and most tutorials will work with SAS as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the w3 tutorials:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.w3schools.com/sql/default.asp" target="_blank"&gt;https://www.w3schools.com/sql/default.asp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the SQL library in the documentation has many good examples:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl//en/sqlproc/69822/HTML/default/viewer.htm#p016wt256y0c2on1dvsm0a7ktvva.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl//en/sqlproc/69822/HTML/default/viewer.htm#p016wt256y0c2on1dvsm0a7ktvva.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the side bar for other common usage cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 22:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583356#M7874</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-22T22:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583357#M7875</link>
      <description>&lt;P&gt;Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even the corrected code&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select fatals, countycode, mean (fatals) as fatalcount
	from county 
	group by countycode;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will cause SQL processor the computed mean here fatalcount merge back(remerge) with the original. Of course we are not aware of what OP's exact WANT but methinks we can make a guess from&lt;EM&gt; "I intend to generate a table that has unique countycodes&amp;nbsp;".&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Therefore excluding fatals from the SELECT should get the desired result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select  countycode, mean (fatals) as fatalcount
	from county 
	group by countycode;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Aug 2019 23:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583357#M7875</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-22T23:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583361#M7876</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;I understand why I keep seeing the syntax error.&lt;/P&gt;&lt;P&gt;Although I did not get a unique ID though.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 23:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583361#M7876</guid>
      <dc:creator>oadeyemi</dc:creator>
      <dc:date>2019-08-22T23:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583362#M7877</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;This worked.&lt;/P&gt;&lt;P&gt;And I generated unique ID.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 23:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583362#M7877</guid>
      <dc:creator>oadeyemi</dc:creator>
      <dc:date>2019-08-22T23:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL syntax errors</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583363#M7878</link>
      <description>&lt;P&gt;Thank you for the link.&lt;/P&gt;&lt;P&gt;Very helpful.&lt;/P&gt;&lt;P&gt;Thanks for the information.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 23:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-SQL-syntax-errors/m-p/583363#M7878</guid>
      <dc:creator>oadeyemi</dc:creator>
      <dc:date>2019-08-22T23:46:17Z</dc:date>
    </item>
  </channel>
</rss>

