<?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: extract data when the variable in the group is different. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/extract-data-when-the-variable-in-the-group-is-different/m-p/494469#M130309</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var group $;
datalines;
12 A
13 A
14 B
15 C
;

proc sql;
   create table want as 
   select * from have
   group by group
   having count(distinct var) &amp;gt; 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Sep 2018 12:47:06 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-09-11T12:47:06Z</dc:date>
    <item>
      <title>extract data when the variable in the group is different.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-data-when-the-variable-in-the-group-is-different/m-p/494465#M130306</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a new data set from the old data set when the variable in the group is different.&lt;/P&gt;&lt;P&gt;for example,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;the old dataset&lt;BR /&gt;&lt;BR /&gt;variable , group 

12, A
13, A

14,B

15,C&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to only keep&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;the new dataset &lt;BR /&gt;&lt;BR /&gt;variable , group 

12, A
13, A&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to use the code like&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA Sa_Step1.appln_new3;
   SET Sa_Step1.appln_new2;
   if count ( case group_name ) &amp;gt;1 ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but it doesn't work. could you please give me a suggestion&amp;nbsp;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;best ragards&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 12:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-data-when-the-variable-in-the-group-is-different/m-p/494465#M130306</guid>
      <dc:creator>France</dc:creator>
      <dc:date>2018-09-11T12:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: extract data when the variable in the group is different.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/extract-data-when-the-variable-in-the-group-is-different/m-p/494469#M130309</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var group $;
datalines;
12 A
13 A
14 B
15 C
;

proc sql;
   create table want as 
   select * from have
   group by group
   having count(distinct var) &amp;gt; 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Sep 2018 12:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/extract-data-when-the-variable-in-the-group-is-different/m-p/494469#M130309</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-09-11T12:47:06Z</dc:date>
    </item>
  </channel>
</rss>

