<?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: Syntax help with PROC SQL statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-help-with-PROC-SQL-statement/m-p/441653#M282650</link>
    <description>&lt;P&gt;Format your code for starters will help to see what doesn't align (and don't use all caps for coding or anything really except emphasis)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
create table work.query as 
select distinct (clm_drg_cd) from
inp.inp_claimsk_lds2016 
where clm_drg_cd='469' or clm_drg_cd='470'
count(clm_drg_cd) as count /*&amp;lt;- in the wrong place*/
group by clm_drg_cd;
contents data=work.query out=work.details;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is probably closer to what you're trying to do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
create table work.query as 
select distinct (clm_drg_cd) , count(clm_drg_cd) as count 
from
inp.inp_claimsk_lds2016 
where clm_drg_cd='469' or clm_drg_cd='470'
group by clm_drg_cd;
quit;


proc contents data=work.query out=work.details;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 02 Mar 2018 17:39:33 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-02T17:39:33Z</dc:date>
    <item>
      <title>Syntax help with PROC SQL statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-help-with-PROC-SQL-statement/m-p/441652#M282649</link>
      <description>&lt;P&gt;PROC SQL ;&lt;BR /&gt;CREATE TABLE WORK.query AS SELECT DISTINCT (CLM_DRG_CD) FROM&lt;BR /&gt;INP.INP_CLAIMSK_LDS2016 WHERE CLM_DRG_CD='469' OR CLM_DRG_CD='470'&lt;BR /&gt;COUNT(CLM_DRG_CD) AS COUNT GROUP BY CLM_DRG_CD;&lt;BR /&gt;CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;61&lt;BR /&gt;62 PROC SQL ;&lt;BR /&gt;63 CREATE TABLE WORK.query AS SELECT DISTINCT (CLM_DRG_CD) FROM&lt;BR /&gt;64 INP.INP_CLAIMSK_LDS2016 WHERE CLM_DRG_CD='469' OR CLM_DRG_CD='470'&lt;BR /&gt;65 COUNT(CLM_DRG_CD) AS COUNT GROUP BY CLM_DRG_CD;&lt;BR /&gt;_____&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ,&lt;BR /&gt;EQT, GE, GET, GROUP, GT, GTT, HAVING, LE, LET, LT, LTT, NE, NET, OR, ORDER, ^=, |, ||, ~=.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;66 CONTENTS DATA=WORK.query OUT=WORK.details;&lt;BR /&gt;________&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;67 RUN;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;68&lt;BR /&gt;69&lt;BR /&gt;70 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;BR /&gt;83&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 17:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-help-with-PROC-SQL-statement/m-p/441652#M282649</guid>
      <dc:creator>fpascal</dc:creator>
      <dc:date>2018-03-02T17:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax help with PROC SQL statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-help-with-PROC-SQL-statement/m-p/441653#M282650</link>
      <description>&lt;P&gt;Format your code for starters will help to see what doesn't align (and don't use all caps for coding or anything really except emphasis)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
create table work.query as 
select distinct (clm_drg_cd) from
inp.inp_claimsk_lds2016 
where clm_drg_cd='469' or clm_drg_cd='470'
count(clm_drg_cd) as count /*&amp;lt;- in the wrong place*/
group by clm_drg_cd;
contents data=work.query out=work.details;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is probably closer to what you're trying to do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
create table work.query as 
select distinct (clm_drg_cd) , count(clm_drg_cd) as count 
from
inp.inp_claimsk_lds2016 
where clm_drg_cd='469' or clm_drg_cd='470'
group by clm_drg_cd;
quit;


proc contents data=work.query out=work.details;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Mar 2018 17:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-help-with-PROC-SQL-statement/m-p/441653#M282650</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-02T17:39:33Z</dc:date>
    </item>
  </channel>
</rss>

