<?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 convert Customer IDs to Customer Base Key? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342082#M78388</link>
    <description>&lt;P&gt;The code as such doesn't make sense.&lt;/P&gt;
&lt;P&gt;- there are no endrsubmit's for the rsubmit's, so it is unclear what is executed where&lt;/P&gt;
&lt;P&gt;- a dataset test is created, but never used&lt;/P&gt;
&lt;P&gt;- a dataset simon is used, but where does it come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can guess that you get a lookup table from DB/2 that contains keys and id's.&lt;/P&gt;
&lt;P&gt;Your first step will be to import the data from the Excel file into SAS. Then you have to make sure that the customer id`s from Excel can be matched to those from DB/2 (same variable attributes, same contents). Then you can join the two tables on customer id.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2017 18:00:06 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-03-17T18:00:06Z</dc:date>
    <item>
      <title>How to convert Customer IDs to Customer Base Key?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342014#M78366</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an excel file which contains customer IDs, and I want to convert customer IDs to custoemr base key.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My manager told me I could do it in SAS, and she gave me a sample. However, I do not know how may I apply the SAS code to Excel like where and how should I input and edit the excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following is the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sql&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;connect to db2(database = owstar);&lt;/P&gt;&lt;P&gt;&amp;nbsp; CREATE table test as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM connection to DB2 (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.cust_base_key,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* a.acct_base_key,*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.prim_cust_f,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.cust_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp; owstar.iwf_cust_acct a join OWTACT.cust_xref b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.CUST_BASE_KEY=b.CUST_BASE_KEY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;where&amp;nbsp; a.time_key in (&lt;STRONG&gt;16636&lt;/STRONG&gt;) /* Oct 2016 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER by&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cust_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QUIT&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;rsubmit;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; simon2;&lt;/P&gt;&lt;P&gt;set simon;&lt;/P&gt;&lt;P&gt;pst = put(cust_id, $20.) ;&lt;/P&gt;&lt;P&gt;drop cust_id;&lt;/P&gt;&lt;P&gt;rename pst =cust_id;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data = simon2;&lt;/P&gt;&lt;P&gt;by cust_id;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; test2 (drop=prim_cust_f);&lt;/P&gt;&lt;P&gt;merge simon2(in=a) test(in=b);&lt;/P&gt;&lt;P&gt;by cust_id;&lt;/P&gt;&lt;P&gt;if a;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;sort&lt;/STRONG&gt; data =test2 out=test3 nodupkey;&lt;/P&gt;&lt;P&gt;by cust_id cust_base_key transit;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342014#M78366</guid>
      <dc:creator>Muyu</dc:creator>
      <dc:date>2017-03-17T15:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Customer IDs to Customer Base Key?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342070#M78381</link>
      <description>&lt;P&gt;Is my code wrong? Why does no one reply me ...&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 17:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342070#M78381</guid>
      <dc:creator>Muyu</dc:creator>
      <dc:date>2017-03-17T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Customer IDs to Customer Base Key?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342082#M78388</link>
      <description>&lt;P&gt;The code as such doesn't make sense.&lt;/P&gt;
&lt;P&gt;- there are no endrsubmit's for the rsubmit's, so it is unclear what is executed where&lt;/P&gt;
&lt;P&gt;- a dataset test is created, but never used&lt;/P&gt;
&lt;P&gt;- a dataset simon is used, but where does it come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can guess that you get a lookup table from DB/2 that contains keys and id's.&lt;/P&gt;
&lt;P&gt;Your first step will be to import the data from the Excel file into SAS. Then you have to make sure that the customer id`s from Excel can be matched to those from DB/2 (same variable attributes, same contents). Then you can join the two tables on customer id.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 18:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-Customer-IDs-to-Customer-Base-Key/m-p/342082#M78388</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-17T18:00:06Z</dc:date>
    </item>
  </channel>
</rss>

