<?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: how to get unique columns in sas dataset in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5749#M1825</link>
    <description>Hi:&lt;BR /&gt;
  I always find it useful to look at a concrete example of data when talking about duplicates. Consider this data:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Obs    a    b     c    d    e&lt;BR /&gt;
  &lt;BR /&gt;
  1    A    AA    1    4    3&lt;BR /&gt;
  2    A    AA    1    4    3&lt;BR /&gt;
  3    A    AA    2    8    3&lt;BR /&gt;
  4    A    BB    4    5    6&lt;BR /&gt;
  5    A    CC    7    8    3&lt;BR /&gt;
  6    B    AA    1    8    3&lt;BR /&gt;
  7    B    AA    1    8    3&lt;BR /&gt;
  8    B    BB    1    4    3&lt;BR /&gt;
  9    B    BB    4    5    6&lt;BR /&gt;
 10    B    CC    5    6    7&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
Would you want to get RID of Observations 2 and 7 which are complete duplicates on EVERY column? &lt;BR /&gt;
&lt;BR /&gt;
Or do you just want to find out what the unique values are? Something like this (produced by PROC FREQ):&lt;BR /&gt;
[pre]&lt;BR /&gt;
Number of Variable Levels&lt;BR /&gt;
  &lt;BR /&gt;
Variable      Levels&lt;BR /&gt;
--------------------&lt;BR /&gt;
a                  2&lt;BR /&gt;
b                  3&lt;BR /&gt;
c                  5&lt;BR /&gt;
d                  4&lt;BR /&gt;
e                  4&lt;BR /&gt;
&lt;BR /&gt;
   &lt;BR /&gt;
a    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
A           5&lt;BR /&gt;
B           5&lt;BR /&gt;
&lt;BR /&gt;
   &lt;BR /&gt;
b     Frequency&lt;BR /&gt;
---------------&lt;BR /&gt;
AA           5&lt;BR /&gt;
BB           3&lt;BR /&gt;
CC           2&lt;BR /&gt;
   &lt;BR /&gt;
&lt;BR /&gt;
c    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
1           5&lt;BR /&gt;
2           1&lt;BR /&gt;
4           2&lt;BR /&gt;
5           1&lt;BR /&gt;
7           1&lt;BR /&gt;
&lt;BR /&gt;
   &lt;BR /&gt;
d    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
4           3&lt;BR /&gt;
5           2&lt;BR /&gt;
6           1&lt;BR /&gt;
8           4&lt;BR /&gt;
   &lt;BR /&gt;
  &lt;BR /&gt;
e    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
3           6&lt;BR /&gt;
6           2&lt;BR /&gt;
7           1&lt;BR /&gt;
9           1&lt;BR /&gt;
  &lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
It is also hard to make a recommendation without knowing what the outcome is supposed to be -- a report -- another data set???&lt;BR /&gt;
&lt;BR /&gt;
Your best bet for help might be to contact Tech Support, because they can look at your data and figure out the best method in EG to accomplish your goal.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Fri, 30 Nov 2007 16:55:33 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2007-11-30T16:55:33Z</dc:date>
    <item>
      <title>how to get unique columns in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5748#M1824</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
   I have a sas date set with 20 colums, say COL A,B,C... . i want to know the unive value of COL A and unique values of COL B and so on. I have a idea to read the same dataset 20 times and get rid of duplicates, but i think this is not an efficeint way of coding. &lt;BR /&gt;
&lt;BR /&gt;
  Could you please help me out of this problem</description>
      <pubDate>Fri, 30 Nov 2007 16:25:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5748#M1824</guid>
      <dc:creator>DPraba79</dc:creator>
      <dc:date>2007-11-30T16:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to get unique columns in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5749#M1825</link>
      <description>Hi:&lt;BR /&gt;
  I always find it useful to look at a concrete example of data when talking about duplicates. Consider this data:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Obs    a    b     c    d    e&lt;BR /&gt;
  &lt;BR /&gt;
  1    A    AA    1    4    3&lt;BR /&gt;
  2    A    AA    1    4    3&lt;BR /&gt;
  3    A    AA    2    8    3&lt;BR /&gt;
  4    A    BB    4    5    6&lt;BR /&gt;
  5    A    CC    7    8    3&lt;BR /&gt;
  6    B    AA    1    8    3&lt;BR /&gt;
  7    B    AA    1    8    3&lt;BR /&gt;
  8    B    BB    1    4    3&lt;BR /&gt;
  9    B    BB    4    5    6&lt;BR /&gt;
 10    B    CC    5    6    7&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
Would you want to get RID of Observations 2 and 7 which are complete duplicates on EVERY column? &lt;BR /&gt;
&lt;BR /&gt;
Or do you just want to find out what the unique values are? Something like this (produced by PROC FREQ):&lt;BR /&gt;
[pre]&lt;BR /&gt;
Number of Variable Levels&lt;BR /&gt;
  &lt;BR /&gt;
Variable      Levels&lt;BR /&gt;
--------------------&lt;BR /&gt;
a                  2&lt;BR /&gt;
b                  3&lt;BR /&gt;
c                  5&lt;BR /&gt;
d                  4&lt;BR /&gt;
e                  4&lt;BR /&gt;
&lt;BR /&gt;
   &lt;BR /&gt;
a    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
A           5&lt;BR /&gt;
B           5&lt;BR /&gt;
&lt;BR /&gt;
   &lt;BR /&gt;
b     Frequency&lt;BR /&gt;
---------------&lt;BR /&gt;
AA           5&lt;BR /&gt;
BB           3&lt;BR /&gt;
CC           2&lt;BR /&gt;
   &lt;BR /&gt;
&lt;BR /&gt;
c    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
1           5&lt;BR /&gt;
2           1&lt;BR /&gt;
4           2&lt;BR /&gt;
5           1&lt;BR /&gt;
7           1&lt;BR /&gt;
&lt;BR /&gt;
   &lt;BR /&gt;
d    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
4           3&lt;BR /&gt;
5           2&lt;BR /&gt;
6           1&lt;BR /&gt;
8           4&lt;BR /&gt;
   &lt;BR /&gt;
  &lt;BR /&gt;
e    Frequency&lt;BR /&gt;
--------------&lt;BR /&gt;
3           6&lt;BR /&gt;
6           2&lt;BR /&gt;
7           1&lt;BR /&gt;
9           1&lt;BR /&gt;
  &lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
It is also hard to make a recommendation without knowing what the outcome is supposed to be -- a report -- another data set???&lt;BR /&gt;
&lt;BR /&gt;
Your best bet for help might be to contact Tech Support, because they can look at your data and figure out the best method in EG to accomplish your goal.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 30 Nov 2007 16:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5749#M1825</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-11-30T16:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to get unique columns in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5750#M1826</link>
      <description>Hi, I need the PROC FREQ , Could you please send me the code</description>
      <pubDate>Fri, 30 Nov 2007 18:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5750#M1826</guid>
      <dc:creator>DPraba79</dc:creator>
      <dc:date>2007-11-30T18:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to get unique columns in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5751#M1827</link>
      <description>Hi,&lt;BR /&gt;
  Here's the code I used.&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc freq data=testfile nlevels;&lt;BR /&gt;
     table a b c d e / nocum nopercent;&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
[/pre]&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 30 Nov 2007 19:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-get-unique-columns-in-sas-dataset/m-p/5751#M1827</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-11-30T19:56:04Z</dc:date>
    </item>
  </channel>
</rss>

