<?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 using distinct function in proc sql need to display all variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933104#M367022</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;is it possible to display role variable after removing duplicates by using PROC SQL? any suggestion, Thanks in advance.&lt;/P&gt;&lt;P&gt;data demo;&lt;BR /&gt;input pid role$;&lt;BR /&gt;cards;&lt;BR /&gt;101 Hr&lt;BR /&gt;102 deveolper&lt;BR /&gt;103 analyst&lt;BR /&gt;101 admin&lt;/P&gt;&lt;P&gt;;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;&lt;BR /&gt;select distinct(pid) from demo; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 09:52:03 GMT</pubDate>
    <dc:creator>sas_aspirant</dc:creator>
    <dc:date>2024-06-20T09:52:03Z</dc:date>
    <item>
      <title>using distinct function in proc sql need to display all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933104#M367022</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;is it possible to display role variable after removing duplicates by using PROC SQL? any suggestion, Thanks in advance.&lt;/P&gt;&lt;P&gt;data demo;&lt;BR /&gt;input pid role$;&lt;BR /&gt;cards;&lt;BR /&gt;101 Hr&lt;BR /&gt;102 deveolper&lt;BR /&gt;103 analyst&lt;BR /&gt;101 admin&lt;/P&gt;&lt;P&gt;;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;&lt;BR /&gt;select distinct(pid) from demo; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 09:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933104#M367022</guid>
      <dc:creator>sas_aspirant</dc:creator>
      <dc:date>2024-06-20T09:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: using distinct function in proc sql need to display all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933112#M367025</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select pid, role, monotonic() as help
	from demo
	group by pid
	having help = min(help)
	;
quit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Test if you can achieve your goal with the code above. For some background read: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/MONOTONIC-function-in-PROC-SQL/ta-p/475752" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/MONOTONIC-function-in-PROC-SQL/ta-p/475752&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 10:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933112#M367025</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2024-06-20T10:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: using distinct function in proc sql need to display all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933113#M367026</link>
      <description>&lt;P&gt;This seems like an incomplete problem description.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which of the two values of ROLE for PID=101 should go into the output? To ask the question in a more general way, when there are multiple values of ROLE for a given PID, which of these records should go into the output?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 11:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933113#M367026</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-06-20T11:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: using distinct function in proc sql need to display all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933122#M367027</link>
      <description>Yeah, I got it. Thank you so much.</description>
      <pubDate>Thu, 20 Jun 2024 11:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933122#M367027</guid>
      <dc:creator>sas_aspirant</dc:creator>
      <dc:date>2024-06-20T11:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: using distinct function in proc sql need to display all variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933136#M367031</link>
      <description>&lt;P&gt;Why use SQL?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=demo out=want nodupkey;
  by pid;
run;
proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2024 13:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-distinct-function-in-proc-sql-need-to-display-all/m-p/933136#M367031</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-20T13:22:03Z</dc:date>
    </item>
  </channel>
</rss>

