<?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 Finding a unique value within a data subset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501518#M133717</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to report on all unique values within a subset of data? For instance looking within the test1 set of data and comparing test1.1 to test1.2 to find that the unique value is 123.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;124&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;521&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;324&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;521&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;124&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;324&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Thu, 04 Oct 2018 15:05:23 GMT</pubDate>
    <dc:creator>alexjaco</dc:creator>
    <dc:date>2018-10-04T15:05:23Z</dc:date>
    <item>
      <title>Finding a unique value within a data subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501518#M133717</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to report on all unique values within a subset of data? For instance looking within the test1 set of data and comparing test1.1 to test1.2 to find that the unique value is 123.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;124&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;521&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.1&lt;/TD&gt;&lt;TD&gt;324&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;521&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;124&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Test1.2&lt;/TD&gt;&lt;TD&gt;324&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501518#M133717</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T15:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a unique value within a data subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501525#M133719</link>
      <description>&lt;P&gt;Yes, but it depends on how you define unique and what do you want as an output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want as the output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501525#M133719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-04T15:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a unique value within a data subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501531#M133721</link>
      <description>&lt;P&gt;Unique value is anything that appears in row three for Test 1.1 that doesn't appear in row three for test 1.2. Output should be the entire row.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There will be other rows such as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;Test2.1&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;Test2.2&lt;/TD&gt;&lt;TD&gt;124&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501531#M133721</guid>
      <dc:creator>alexjaco</dc:creator>
      <dc:date>2018-10-04T15:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a unique value within a data subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501536#M133725</link>
      <description>&lt;P&gt;Pretty vague example of desired output.&lt;/P&gt;
&lt;P&gt;I am guessing that something like this might get you started;&lt;/P&gt;
&lt;PRE&gt;proc freq data=have noprint;
  tables var1*var2*var3 /missing list out=work.unique(where=(count=1));
run;&lt;/PRE&gt;
&lt;P&gt;Where you place the variables whose combination of "uniqueness" on the tables statement as above, use as man * as you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inclusion of the missing option depends on whether you want to count combinations with one or more missing values as a unique combination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are more than one data sets involved, which is not actually very clear, then more details are needed and likely some actual example data in the form of data steps to create the example data sets.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501536#M133725</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-04T15:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a unique value within a data subset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501643#M133784</link>
      <description>&lt;P&gt;You give us three columns of data, so I'm going to imagine that the variable names are v1 v2 and v3.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;&lt;/P&gt;
&lt;P&gt;by v1 v3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge have (in=in1 where=(v2='Test1.1'))&lt;/P&gt;
&lt;P&gt;have (in=in2 where=(v2='Test1.2'));&lt;/P&gt;
&lt;P&gt;by v1 v3;&lt;/P&gt;
&lt;P&gt;if in1=0 or in2=0;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 18:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-a-unique-value-within-a-data-subset/m-p/501643#M133784</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-04T18:29:44Z</dc:date>
    </item>
  </channel>
</rss>

