<?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 New post-Recognize accounts with similar ownership ID's in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797390#M287493</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have the following problem:&lt;/P&gt;
&lt;P&gt;I have 2&amp;nbsp; data sets:&lt;/P&gt;
&lt;P&gt;1- Data set Have1 with following columns:&lt;/P&gt;
&lt;P&gt;Customer_account , date,amount&lt;/P&gt;
&lt;P&gt;This data set includes information on transactions that customer have in their bank account&lt;/P&gt;
&lt;P&gt;2-Data set Have2&amp;nbsp;with following columns:&lt;/P&gt;
&lt;P&gt;Customer_account,ID&lt;/P&gt;
&lt;P&gt;This data set includes information on the owners' ID of each account&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The task is to create&amp;nbsp; a new calculated field to data set Have1&amp;nbsp; that will be called "calc_key".&lt;/P&gt;
&lt;P&gt;This field will get the concatenation of customer accounts that have at least one common ID in their ownership.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;Customer_ID 111 has two ID's: 39998888 and 36777333&lt;/P&gt;
&lt;P&gt;Customer_ID 222 has one ID :36777333&lt;/P&gt;
&lt;P&gt;So accounts 111 and 222 have common ID's and both will get value "111_222"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to perform this task please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have1;
format date date9.;
Input  Customer_account  date :date9. amount ;
Cards;
111	01/10/2021	2000
222	01/10/2021	3000
222	01/12/2021	1500
111	01/12/2021	5000
333	01/10/2021	800
444	27/02/2021	2000
555	19/03/2021	2700
444	19/03/2021	300
;
Run;

Data Have2;
input Customer_account  ID;
cards;
111	39998888
111	36777333
222	36777333
333	6788888
444	9898888
555	9898888
555	827777
;
Run;

Data wanted;
Input Input  Customer_account  date :date9. amount  Calc_Key $;
cards;
111	01/10/2021 2000 111_222
222	01/10/2021 3000 111_222
222	01/12/2021 1500 111_222
111	01/12/2021 5000 111_222
333	01/10/2021 800 333_444_555
444	27/02/2021 2000 333_444_555
555	19/03/2021 2700 333_444_555
444	19/03/2021 300 333_444_555
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Feb 2022 16:15:00 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-02-19T16:15:00Z</dc:date>
    <item>
      <title>Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797366#M287471</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have the following problem.&lt;/P&gt;
&lt;P&gt;There is one data set called Have1 with following columns:&lt;/P&gt;
&lt;P&gt;Customer_account , date,amount&lt;/P&gt;
&lt;P&gt;This data set includes information&amp;nbsp; on transactions of customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is another data set caled Have2 with the following columns:&lt;/P&gt;
&lt;P&gt;Customer_account&lt;/P&gt;
&lt;P&gt;ID_number&lt;/P&gt;
&lt;P&gt;This data set included information of ownership of the customers.&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Customer_account 111 has 2 people in its ownership (for example: husband and wife)&lt;/P&gt;
&lt;P&gt;Customer_account 222&amp;nbsp; has only one person on its ownership&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The task is to identify customer_ID's with similar ownership.&lt;/P&gt;
&lt;P&gt;It means that If there is at least one ID that is common in 2 or more&amp;nbsp;Customer accounts&amp;nbsp; then I want to put these accounts under same category.&lt;/P&gt;
&lt;P&gt;I want to recognize it by create a new Key column that will recieve same key number of all customer accounts with similar ownership.&lt;/P&gt;
&lt;P&gt;The calc_key field can have any number but the most important that accounts with similar ownership will have same value in this field.&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have1;
Format Date date9.;
Input Customer_ID	 Date : date9. Amount;
Cards;
111	01/10/2021	2000
222	01/10/2021	3000
222	01/12/2021	1500
111	01/12/2021	5000
333	01/10/2021	800
444	27/02/2021	2000
555	19/03/2021	2700
444	19/03/2021	300
;
Run;

Data Have2;
Input  Customer_ID	ID_number   ;
Cards;
111	39998888
111	36777333
222	36777333
333	6788888
444	9898888
555	9898888
555	827777
;
Run;

Data wanted;
format date9.;
Input Customer_ID	Date :date9.	Amount	Calc_Key;
Cards;
111	01/10/2021 2000 1
222	01/10/2021 3000 1
222	01/12/2021 1500 1
111	01/12/2021 5000 1
333	01/10/2021 800 2
444	27/02/2021 2000 2
555	19/03/2021 2700 3
444	19/03/2021 300 2

&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 08:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797366#M287471</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T08:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797375#M287478</link>
      <description>&lt;P&gt;Why does 555 have calc_key=3 in the WANT data set?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 11:06:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797375#M287478</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-19T11:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797379#M287482</link>
      <description>The calculated key number is just a way to recognize which   accounts have common owners....I just wrote random numbers do key 3 can be any other number...</description>
      <pubDate>Sat, 19 Feb 2022 12:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797379#M287482</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T12:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797380#M287483</link>
      <description>&lt;P&gt;Random numbers don't help us to program a correct solution. Please change WANT to have the correct answers.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 12:29:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797380#M287483</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-19T12:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797381#M287484</link>
      <description>The task is to generate key numbers ( any random numbers) with criteria that any accounts  with common owners will have same key and also that the key will be unique so other accounts with different  owners will have different  key...</description>
      <pubDate>Sat, 19 Feb 2022 12:32:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797381#M287484</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T12:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797382#M287485</link>
      <description>I just wrote example to key numbers.&lt;BR /&gt;The key numbers can be any numbers but as I said the requirements are:&lt;BR /&gt;1- accounts with common owners have same key number &lt;BR /&gt;2- accounts with non common owners  have different  key</description>
      <pubDate>Sat, 19 Feb 2022 12:50:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797382#M287485</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T12:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797383#M287486</link>
      <description>Also possible  that the key will be concatenation  of accounts id's&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Feb 2022 13:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797383#M287486</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T13:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797384#M287487</link>
      <description>&lt;P&gt;So show us the WANT data set that you need, so we can program it and confirm that our code is giving the right answer. Don't make us figure out what is right if you already know what is right. In this situation, you have to help us out before we can help you out.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 14:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797384#M287487</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-19T14:31:19Z</dc:date>
    </item>
    <item>
      <title>New post-Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797390#M287493</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have the following problem:&lt;/P&gt;
&lt;P&gt;I have 2&amp;nbsp; data sets:&lt;/P&gt;
&lt;P&gt;1- Data set Have1 with following columns:&lt;/P&gt;
&lt;P&gt;Customer_account , date,amount&lt;/P&gt;
&lt;P&gt;This data set includes information on transactions that customer have in their bank account&lt;/P&gt;
&lt;P&gt;2-Data set Have2&amp;nbsp;with following columns:&lt;/P&gt;
&lt;P&gt;Customer_account,ID&lt;/P&gt;
&lt;P&gt;This data set includes information on the owners' ID of each account&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The task is to create&amp;nbsp; a new calculated field to data set Have1&amp;nbsp; that will be called "calc_key".&lt;/P&gt;
&lt;P&gt;This field will get the concatenation of customer accounts that have at least one common ID in their ownership.&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;Customer_ID 111 has two ID's: 39998888 and 36777333&lt;/P&gt;
&lt;P&gt;Customer_ID 222 has one ID :36777333&lt;/P&gt;
&lt;P&gt;So accounts 111 and 222 have common ID's and both will get value "111_222"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the way to perform this task please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Have1;
format date date9.;
Input  Customer_account  date :date9. amount ;
Cards;
111	01/10/2021	2000
222	01/10/2021	3000
222	01/12/2021	1500
111	01/12/2021	5000
333	01/10/2021	800
444	27/02/2021	2000
555	19/03/2021	2700
444	19/03/2021	300
;
Run;

Data Have2;
input Customer_account  ID;
cards;
111	39998888
111	36777333
222	36777333
333	6788888
444	9898888
555	9898888
555	827777
;
Run;

Data wanted;
Input Input  Customer_account  date :date9. amount  Calc_Key $;
cards;
111	01/10/2021 2000 111_222
222	01/10/2021 3000 111_222
222	01/12/2021 1500 111_222
111	01/12/2021 5000 111_222
333	01/10/2021 800 333_444_555
444	27/02/2021 2000 333_444_555
555	19/03/2021 2700 333_444_555
444	19/03/2021 300 333_444_555
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 16:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797390#M287493</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T16:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797391#M287492</link>
      <description>&lt;P&gt;I wrote it again in a new post&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data wanted;
Format date date9.;
input Customer_ID	Date :Date9.	Amount	Calc_Key $  ;
cards;
111	01/10/2021 2000 111_222
222	01/10/2021 3000 111_222
222	01/12/2021 1500 111_222
111	01/12/2021 5000 111_222
333	01/10/2021 800 333_444_555
444	27/02/2021 2000 333_444_555
555	19/03/2021 2700 333_444_555
444	19/03/2021 300 333_444_555
;
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Feb 2022 16:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797391#M287492</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-02-19T16:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Recognize accounts with similar ownership ID's</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797392#M287494</link>
      <description>&lt;P&gt;I moved the new thread back in&amp;nbsp;&lt;EM&gt;here&lt;/EM&gt;, where it belongs.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2022 16:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recognize-accounts-with-similar-ownership-ID-s/m-p/797392#M287494</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-19T16:51:05Z</dc:date>
    </item>
  </channel>
</rss>

