<?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: Key for nodupkey in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821840#M324484</link>
    <description>&lt;P&gt;It sounds like you have one data set that is unsorted and you want to check whether the unique values in the data match a specified set of "target" values, which are in a second data set. To do that you can use PROC SORT with the NODUP option and compare the output to the set of "target" values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* orig data */
data Have;
input x @@;
datalines;
4 3 2 5 6 4 3 2 2 2 3 5 4 7
;
proc sort data=Have nodup out=Want;
  by x;
run;

/* unique values ("target" values) that we want to compare against */
data Unique;
input x @@;
datalines;
2 3 4 5 6 7
;

proc compare base=Unique compare=Want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Jul 2022 13:42:20 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2022-07-06T13:42:20Z</dc:date>
    <item>
      <title>Key for nodupkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821792#M324460</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a file with duplicate values and the same data with no duplicate values. I can import the 2 files. Do you know please how to find the key of sorting ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 09:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821792#M324460</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-07-06T09:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Key for nodupkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821800#M324462</link>
      <description>&lt;P&gt;I am sure that i don't understand your problem.&lt;/P&gt;
&lt;P&gt;If you use proc sort with "presorted" options, sas will only sort the dataset if it is not already sorted by the variable you provide.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 10:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821800#M324462</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-07-06T10:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Key for nodupkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821804#M324464</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp; Put yourself into our shoes and assume you read below without any further information and context:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I have a file with duplicate values and the same data with no duplicate values. I can import the 2 files. Do you know please how to find the key of sorting ?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;...and now that you understand please try and provide all the necessary information so we can help you to help yourself.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 12:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821804#M324464</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-07-06T12:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Key for nodupkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821808#M324466</link>
      <description>Hello Patrick,&lt;BR /&gt;I mean that I would like to do the proc compare between sorted and not sorted data. But I don’t know if proc compare can indicate the duplicate values. Thank you for your help.</description>
      <pubDate>Wed, 06 Jul 2022 12:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821808#M324466</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-07-06T12:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Key for nodupkey</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821840#M324484</link>
      <description>&lt;P&gt;It sounds like you have one data set that is unsorted and you want to check whether the unique values in the data match a specified set of "target" values, which are in a second data set. To do that you can use PROC SORT with the NODUP option and compare the output to the set of "target" values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* orig data */
data Have;
input x @@;
datalines;
4 3 2 5 6 4 3 2 2 2 3 5 4 7
;
proc sort data=Have nodup out=Want;
  by x;
run;

/* unique values ("target" values) that we want to compare against */
data Unique;
input x @@;
datalines;
2 3 4 5 6 7
;

proc compare base=Unique compare=Want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 13:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Key-for-nodupkey/m-p/821840#M324484</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-07-06T13:42:20Z</dc:date>
    </item>
  </channel>
</rss>

