<?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 Proc sql, Select Distinct and not Distinct variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql-Select-Distinct-and-not-Distinct-variables/m-p/391946#M66249</link>
    <description>&lt;P&gt;I'd like to keep 'age_in_days' in data plot which is obvisouly not distinct. Putting age_in_days after 'having' and before 'distinct' in select statement didn't work out.&lt;/P&gt;&lt;P&gt;My goal is to line graph 'age_in_days' against 'tot'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 create table plot as
 select distinct id,a1, a2, a3
  from temp1
  where (0 &amp;lt;= age_in_days &amp;lt;= 10)
  group id, a1, a2, a3
  having date = min(date); 
quit; &lt;BR /&gt;&lt;BR /&gt;proc transpose data=plot out=final;&lt;BR /&gt;run;&lt;BR /&gt;data final1(keep=tot _NAME_); set final;&lt;BR /&gt;tot=sum(of Col:);&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2017 17:30:45 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2017-08-30T17:30:45Z</dc:date>
    <item>
      <title>Proc sql, Select Distinct and not Distinct variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql-Select-Distinct-and-not-Distinct-variables/m-p/391946#M66249</link>
      <description>&lt;P&gt;I'd like to keep 'age_in_days' in data plot which is obvisouly not distinct. Putting age_in_days after 'having' and before 'distinct' in select statement didn't work out.&lt;/P&gt;&lt;P&gt;My goal is to line graph 'age_in_days' against 'tot'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 create table plot as
 select distinct id,a1, a2, a3
  from temp1
  where (0 &amp;lt;= age_in_days &amp;lt;= 10)
  group id, a1, a2, a3
  having date = min(date); 
quit; &lt;BR /&gt;&lt;BR /&gt;proc transpose data=plot out=final;&lt;BR /&gt;run;&lt;BR /&gt;data final1(keep=tot _NAME_); set final;&lt;BR /&gt;tot=sum(of Col:);&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 17:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql-Select-Distinct-and-not-Distinct-variables/m-p/391946#M66249</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-08-30T17:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql, Select Distinct and not Distinct variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-sql-Select-Distinct-and-not-Distinct-variables/m-p/392061#M66260</link>
      <description>&lt;P&gt;Can you give us a sample of your data in the form of "have" and "want" data sets please? If it's difficult to advise you without knowing what your data looks like.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2017 23:23:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-sql-Select-Distinct-and-not-Distinct-variables/m-p/392061#M66260</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-08-30T23:23:16Z</dc:date>
    </item>
  </channel>
</rss>

