<?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 identify variable (or combination of variables) that would uniquely identify a record? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90575#M25873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi SGB, Ballardw, PGStats, Patrick and Art,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you very much for every one of you for putting your valuable time on this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;All responses shed me intellectual lights in different aspects that I haven’t even thought of. I am still too immature to understand some.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I had data for 9 banks. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Bank_number,&amp;nbsp; Account_number&amp;nbsp;&amp;nbsp; and Current_date&amp;nbsp;&amp;nbsp; made a unique record for 8 banks out of 9. For one bank, I could not find what is the combination of variables that would make a unique record. Now I am almost there to find it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank again for these intellectual responses.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Mirisage&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Aug 2012 01:02:26 GMT</pubDate>
    <dc:creator>Mirisage</dc:creator>
    <dc:date>2012-08-12T01:02:26Z</dc:date>
    <item>
      <title>How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90568#M25866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;I have a data set like this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt;Informat current_date date9.;&lt;BR /&gt;input current_date Acct_no Balance&amp;nbsp; Name $ 20-26 Product $ 28-41&lt;BR /&gt;Bank_number;&lt;BR /&gt;Format current_date date9.;&lt;BR /&gt;datalines;&lt;BR /&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 5 Kim Lee Personal Loan 10&lt;BR /&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 1 Kim Lee Personal Loan 20&lt;BR /&gt;31JUL2010 1111&amp;nbsp; 25 Kim Lee Personal Loan 30&lt;BR /&gt;31JUL2010 1111&amp;nbsp; 75 Kim Lee Res. Mortgage 30&lt;BR /&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 8 Kim Lee Personal OD&amp;nbsp;&amp;nbsp; 40&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;I want to identify a variable or more that would uniquely identify a&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #800000;"&gt;record.&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff00ff; font-size: 14pt;"&gt;Tom has generously provided me with the very valauble code below. When you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff00ff; font-size: 14pt;"&gt;have run the complete set of codes, it will do the job.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;In the code below, you can keep increasing "ways 1" number until you'll&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;get variable (or variables) that would uniquely identify a record.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc summary data=a chartype missing;&lt;BR /&gt;&amp;nbsp; class _all_;&lt;BR /&gt;&amp;nbsp; output out=summary&amp;nbsp; / levels ways;&lt;BR /&gt;&amp;nbsp; ways 1; &lt;SPAN style="color: #ff00ff;"&gt;/*you can keep increasing this number until you'll get variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff00ff;"&gt;(or variables) that would uniquely identify a record */&lt;/SPAN&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint ;&lt;BR /&gt;&amp;nbsp; create table unique as&lt;BR /&gt;&amp;nbsp; select distinct _way_,_type_&lt;BR /&gt;&amp;nbsp; from summary&lt;BR /&gt;&amp;nbsp; group by _type_&lt;BR /&gt;&amp;nbsp; having max(_freq_)=1&lt;BR /&gt;&amp;nbsp; order by _way_,_type_&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;proc transpose data=a (obs=0) out=names;&lt;BR /&gt;&amp;nbsp; var _all_;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data keys ;&lt;BR /&gt;&amp;nbsp; set unique ;&lt;BR /&gt;&amp;nbsp; length sortkey $200 ;&lt;BR /&gt;&amp;nbsp; do i=1 to length(_type_) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(_type_,i,1)='1' then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set names point=i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sortkey=catx(' ',sortkey,_name_);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; drop _name_;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Proc freq data=keys;&lt;BR /&gt;&amp;nbsp; tables sortkey;&lt;BR /&gt;run;&lt;BR /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG style="color: #ff0000; font-size: 14pt; text-decoration: underline;"&gt;Question:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I put "ways 1" in the First "proc summary" code above.&lt;BR /&gt;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;Then ran the entire code pieces on my almost million data set&lt;BR /&gt;which has 37 variables.&lt;/LI&gt;&lt;LI&gt;Then code ran smoothly and finally said "there is no single unique&lt;BR /&gt;variable".&lt;BR /&gt;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;Then I put "ways 2" and re-ran. Then code ran smoothly and finally&lt;BR /&gt;said "there are no two variables taht would uniquely identify a record".&lt;BR /&gt;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;Then I put "ways 3" and re-ran. Then SAS got crashed.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;So, now I cannot proceed to identidy the unique vairiables in my dataset.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #ff0000;"&gt;I wonder if there is a remedy for this or an alternative way of&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;identifying unique record/s that could handle million dataset with 37&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;variables?&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thank you&lt;BR /&gt;Mirisage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 19:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90568#M25866</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-08-10T19:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90569#M25867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data a;&lt;BR /&gt;informat current_date date9.;&lt;BR /&gt;input current_date Acct_no Balance&amp;nbsp; Name $ 20-26 Product $ 28-41 Bank_number;&lt;BR /&gt;Format current_date date9.;&lt;BR /&gt;datalines;&lt;BR /&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 5 Kim Lee Personal Loan 10&lt;BR /&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 1 Kim Lee Personal Loan 20&lt;BR /&gt;31JUL2010 1111&amp;nbsp; 25 Kim Lee Personal Loan 30&lt;BR /&gt;31JUL2010 1111&amp;nbsp; 75 Kim Lee Res. Mortgage 30&lt;BR /&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 8 Kim Lee Personal OD&amp;nbsp;&amp;nbsp; 40&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try the following method..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc freq data=a nlevels;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; tables current_date Acct_no Balance&amp;nbsp; Name Product Bank_number; * Here you need to add all the variables;&lt;BR /&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable balance has 5 levels.. you have five records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output will look like this&lt;/P&gt;&lt;TABLE cellpadding="3" cellspacing="0" class="Table" frame="box" rules="all" summary="Procedure Freq: NLevels"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="l RowHeader" scope="row"&gt;current_date&lt;/TH&gt;&lt;TD class="r Data"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="l RowHeader" scope="row"&gt;Acct_no&lt;/TH&gt;&lt;TD class="r Data"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="l RowHeader" scope="row"&gt;Balance&lt;/TH&gt;&lt;TD class="r Data"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="l RowHeader" scope="row"&gt;Name&lt;/TH&gt;&lt;TD class="r Data"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="l RowHeader" scope="row"&gt;Product&lt;/TH&gt;&lt;TD class="r Data"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="l RowHeader" scope="row"&gt;Bank_number&lt;/TH&gt;&lt;TD class="r Data"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 20:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90569#M25867</guid>
      <dc:creator>SGB</dc:creator>
      <dc:date>2012-08-10T20:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90570#M25868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason you cannot use something like _n_ to add a new variable as an id?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 21:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90570#M25868</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-08-10T21:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90571#M25869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You realize that to find a set of three variables with the property that you want, among an ensemble of 37 variables, there are 7770 combinations to check? And that each check amounts to something like a sort?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can focus on a smaller number of variable combinations by noticing that the product of the level counts suggested by SGB above for a combination of variables must be greater or equal to the number of observations in your dataset, otherwise that combination cannot identify uniquely all obs.&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, 11 Aug 2012 01:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90571#M25869</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-11T01:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90572#M25870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Building on my previous suggestion and SGB idea, you could find the&lt;EM&gt; best&lt;/EM&gt; variable combination candidates using this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data A;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;informat current_date date9.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;input current_date Acct_no Balance&amp;nbsp; Name $ 20-26 Product $ 28-41 Bank_number;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Format current_date date9.;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 5 Kim Lee Personal Loan 10&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 1 Kim Lee Personal Loan 20&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;31JUL2010 1111&amp;nbsp; 25 Kim Lee Personal Loan 30&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;31JUL2010 1111&amp;nbsp; 75 Kim Lee Res. Mortgage 30&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;31JUL2010 1111&amp;nbsp;&amp;nbsp; 8 Kim Lee Personal OD&amp;nbsp;&amp;nbsp; 40&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc freq data=A nlevels;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; tables current_date Acct_no Balance&amp;nbsp; Name Product Bank_number /* ... */ / noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp; ods output NLevels=nlev;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc sql noprint;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select quote(trim(tableVar)) into :tableVars separated by ","&amp;nbsp; from nlev;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select NLevels into :NLevels separated by "," from nlev;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select count(*) into :Nvars from nlev;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select count(*) into :nobs from A;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;%let combs=3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;data comb(keep=var: comb);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;array tableVar{&amp;amp;Nvars} $16 (&amp;amp;tableVars);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;array NLevel{&amp;amp;Nvars} (&amp;amp;NLevels);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;array II{&amp;amp;combs};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;array var{&amp;amp;combs} $16 ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;do i = 1 to comb(&amp;amp;Nvars, &amp;amp;combs);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call allcombi(&amp;amp;Nvars,&amp;amp;combs,of II{*});&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comb = 1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j = 1 to &amp;amp;combs;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var{j} = tableVar{II{j}};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; comb = comb * NLevel{II{j}};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if comb &amp;gt;= &amp;amp;nobs then output;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;proc sql outobs=10; /* Limit the size of output list */&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;select * from comb order by comb desc;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;quit;&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, 11 Aug 2012 02:34:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90572#M25870</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-11T02:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90573#M25871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm very much with "ballardw" that you should create your own ID - and this could just be a simple data step with a line of command like:&amp;nbsp;&amp;nbsp;&amp;nbsp; ID=_N_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might find a unique combination of variables with an algorithm - but this combination of variables might then only be valid for exactly the set of data you've derived it from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should know your data and try to figure out on a conceptual level which combination of variables MUST be unique. This would also allow you to validate your actual data (data quality issues?). If there is no unique combination (=primary composite key or alternate key or natural key) then creating a surrogate key is may be a very good idea (eg. via ID=_N_;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Aug 2012 08:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90573#M25871</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-08-11T08:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90574#M25872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't heard anyone ask it yet, so I will: why do you want to uniquely identify each record (beyond the fact that they already are physically uniquely identifiable)?&amp;nbsp; Wouldn't you be better off having an id field that accurately captured all of just one person's records?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Aug 2012 13:06:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90574#M25872</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-08-11T13:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90575#M25873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi SGB, Ballardw, PGStats, Patrick and Art,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you very much for every one of you for putting your valuable time on this. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;All responses shed me intellectual lights in different aspects that I haven’t even thought of. I am still too immature to understand some.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I had data for 9 banks. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Bank_number,&amp;nbsp; Account_number&amp;nbsp;&amp;nbsp; and Current_date&amp;nbsp;&amp;nbsp; made a unique record for 8 banks out of 9. For one bank, I could not find what is the combination of variables that would make a unique record. Now I am almost there to find it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank again for these intellectual responses.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Mirisage&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2012 01:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90575#M25873</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-08-12T01:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90576#M25874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately there is not a world wide standard for bank account numbers. There are standards like IBAN used in a lot of European countries or SWIFT/BIC codes for international funds transfers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A lot of banks explain on their website what kind of account numbers they are using and how they are constructed. It might be worth to check it for "your" banks as it could help you to determine the primary key for your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example for your 9th bank: It could be that the branch number is needed as well {bank, branch, account, data}.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2012 01:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90576#M25874</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-08-12T01:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify variable (or combination of variables) that would uniquely identify a record?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90577#M25875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;You are right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been just mechanically striving to create whatever variable combination that would make a unique record which alone wouldn't work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should contact the relevant bank and ask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I learned a lot through this discussion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mirisage&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2012 12:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-identify-variable-or-combination-of-variables-that-would/m-p/90577#M25875</guid>
      <dc:creator>Mirisage</dc:creator>
      <dc:date>2012-08-12T12:45:20Z</dc:date>
    </item>
  </channel>
</rss>

