<?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: Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177694#M302453</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;proc sort data=abc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;data abc1 eid(keep=eid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; set abc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if first.eid=1 then count=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; count+1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if _N_ &amp;lt;&amp;gt; 1 and count&amp;gt;1 then output eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;proc sort data=eid nodupkey;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;data abc_op;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; merge abc(in=a) eid(in=b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if a=1 and b=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Any other simple solutions of doing this in a data step ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;By&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.biginfoanalysis.com"&gt;http://www.biginfoanalysis.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Apr 2014 18:32:11 GMT</pubDate>
    <dc:creator>WWW_BIGINFOANALYSIS_COM</dc:creator>
    <dc:date>2014-04-12T18:32:11Z</dc:date>
    <item>
      <title>Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177691#M302450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all; Thanks in advance for your answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is&lt;/P&gt;&lt;P&gt;how to choose the rows where eid occurring more than once?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;input eid name$ age;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;100 ppp 26&lt;/P&gt;&lt;P&gt;100 ppp 26&lt;/P&gt;&lt;P&gt;100 ppp 25&lt;/P&gt;&lt;P&gt;101 qqq 32&lt;/P&gt;&lt;P&gt;102 qqw 31&lt;/P&gt;&lt;P&gt;102 qqq 32&lt;/P&gt;&lt;P&gt;104 yyy 53&lt;/P&gt;&lt;P&gt;102 xxx 51&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2014 17:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177691#M302450</guid>
      <dc:creator>manjo</dc:creator>
      <dc:date>2014-04-12T17:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177692#M302451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from abc group by eid having count(*)&amp;gt;1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2014 17:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177692#M302451</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-12T17:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177693#M302452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;H5 style="font-weight: normal; font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PGStats&lt;/H5&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2014 18:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177693#M302452</guid>
      <dc:creator>manjo</dc:creator>
      <dc:date>2014-04-12T18:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177694#M302453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;proc sort data=abc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;data abc1 eid(keep=eid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; set abc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if first.eid=1 then count=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; count+1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if _N_ &amp;lt;&amp;gt; 1 and count&amp;gt;1 then output eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;proc sort data=eid nodupkey;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;data abc_op;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; merge abc(in=a) eid(in=b);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; by eid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;nbsp; if a=1 and b=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Any other simple solutions of doing this in a data step ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;By&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.biginfoanalysis.com"&gt;http://www.biginfoanalysis.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2014 18:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177694#M302453</guid>
      <dc:creator>WWW_BIGINFOANALYSIS_COM</dc:creator>
      <dc:date>2014-04-12T18:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177695#M302454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=abc; by eid; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set abc; by eid;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if not (first.eid and last.eid);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=want noobs; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2014 19:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177695#M302454</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-04-12T19:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177696#M302455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data step version solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data abc;
input eid name$ age;
cards;
100 ppp 26
100 ppp 26
100 ppp 25
101 qqq 32
102 qqw 31
102 qqq 32
104 yyy 53
102 xxx 51
;
run;
proc sort data=abc;by eid;run;
data want;
 set abc;
 by eid;
 if not (first.eid and last.eid);
run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Apr 2014 02:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help/m-p/177696#M302455</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-04-13T02:41:47Z</dc:date>
    </item>
  </channel>
</rss>

