<?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 Replicate first processing using proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replicate-first-processing-using-proc-sql/m-p/264479#M51874</link>
    <description>&lt;P&gt;&lt;BR /&gt;data t;&lt;BR /&gt;input name$ age sal;&lt;BR /&gt;cards;&lt;BR /&gt;pawan 25 60000&lt;BR /&gt;pawan 25 60000&lt;BR /&gt;pawan 31 600000&lt;BR /&gt;raj 22 50000&lt;BR /&gt;rahul 24 450000&lt;BR /&gt;rahul 24 422222&lt;BR /&gt;pawan 25 60000&lt;BR /&gt;;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have this dataset and i want only first unique record through sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the desires output is&lt;/P&gt;
&lt;P&gt;pawan 25 60000&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;raj 22 50000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;rahul 24 450000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can do with proc sort but want to do with proc sql.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Apr 2016 09:10:11 GMT</pubDate>
    <dc:creator>pawandh</dc:creator>
    <dc:date>2016-04-18T09:10:11Z</dc:date>
    <item>
      <title>Replicate first processing using proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replicate-first-processing-using-proc-sql/m-p/264479#M51874</link>
      <description>&lt;P&gt;&lt;BR /&gt;data t;&lt;BR /&gt;input name$ age sal;&lt;BR /&gt;cards;&lt;BR /&gt;pawan 25 60000&lt;BR /&gt;pawan 25 60000&lt;BR /&gt;pawan 31 600000&lt;BR /&gt;raj 22 50000&lt;BR /&gt;rahul 24 450000&lt;BR /&gt;rahul 24 422222&lt;BR /&gt;pawan 25 60000&lt;BR /&gt;;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have this dataset and i want only first unique record through sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the desires output is&lt;/P&gt;
&lt;P&gt;pawan 25 60000&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;raj 22 50000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;rahul 24 450000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can do with proc sort but want to do with proc sql.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2016 09:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replicate-first-processing-using-proc-sql/m-p/264479#M51874</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-04-18T09:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replicate-first-processing-using-proc-sql/m-p/264503#M51884</link>
      <description>&lt;P&gt;Define "first record" in terms of the data you have. &amp;nbsp;You can't because you are assuming first based on logical observation number. &amp;nbsp;In my opinion this is not a valid technique, observation position can change, and this is why directly in SQL you can't do this. &amp;nbsp;You need to provide an exact sort based on the data elements. &amp;nbsp;In conclusion I would ascertain why this record:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;rahul 24 450000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should appear before:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;rahul 24 422222&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As logically the reverse should be true - or is it reverse sorted?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now you can fool it by adding an extra data element:&lt;/P&gt;
&lt;PRE&gt;data t;
  input name$ age sal;
cards;
pawan 25 60000
pawan 25 60000
pawan 31 600000
raj 22 50000
rahul 24 450000
rahul 24 422222
pawan 25 60000
;
run;

data t;
  set t;
  n=_n_;
run;

proc sql;
  create table WANT as
  select  *
  from    T
  group by NAME
  having   N=min(N);
quit;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Apr 2016 08:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replicate-first-processing-using-proc-sql/m-p/264503#M51884</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-18T08:41:19Z</dc:date>
    </item>
  </channel>
</rss>

