<?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: update a table by another table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184607#M46952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks skillman! Based on your hint, I found sas statement and tried codes as below. It works! &lt;/P&gt;&lt;P&gt;However, the observations in created table try2001 are more than observations in table a. &lt;/P&gt;&lt;P&gt;Is it correct? Is it supposed to have same number of rows? Is it because there are more than one row for same claim_id of same id in table b?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table try2001 as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *, case prc2001.cpt&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '100' then 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '200' then 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '300' then 3 &lt;/P&gt;&lt;P&gt;&amp;nbsp; when '400' then 4&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '500' then 5&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '600' then 6 &lt;/P&gt;&lt;P&gt;&amp;nbsp; when '700' then 7&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '800' then 8&lt;/P&gt;&lt;P&gt;&amp;nbsp; end as procedure&lt;/P&gt;&lt;P&gt;&amp;nbsp; from a&lt;/P&gt;&lt;P&gt;&amp;nbsp; left join b&lt;/P&gt;&lt;P&gt;&amp;nbsp; on a.id = b.id and a.claim_id = b.claim_id;&lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Feb 2015 01:18:05 GMT</pubDate>
    <dc:creator>michellel</dc:creator>
    <dc:date>2015-02-27T01:18:05Z</dc:date>
    <item>
      <title>update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184604#M46949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two tables. Table A contains id (which refers to people), claim_id, icd9, and other variables not important. Table B contains id (which refers to people), claim_id, CPT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These two tables are linked by id and claim_id. Each claim_id of each id in Table A corresponds to several same/different CPTs for the same claim_id of the same id in table B. There are eight different codes in variable CPT in table B. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to keep table A and create eight dummy variables (1/0) CPT_1, CPT_2, ...... , CPT_8 in table A based on the variable CPT in table B by sql. I have to use sql instead of merge two files together because it will have too many duplicates. I just want to create eight dummy variables in table A to indicate which CPT took for each claim of each person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update A &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I do not know how to create new variables based on variable in table B)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by id, claim_id;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 20:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184604#M46949</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-26T20:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184605#M46950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried the decode function? This works in Oracle, but have not tested in proc sql, but should be something along these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table all_cpt_values as&lt;/P&gt;&lt;P&gt;select distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.claim_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.icd9,&lt;/P&gt;&lt;P&gt;&amp;nbsp; max(decode(b1.cpt = /*Value for CPT_1*/, 1)) as cpt_1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; max(decode(b1.cpt = /*Value for CPT_2*/, 1)) as cpt_2&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; select &lt;/P&gt;&lt;P&gt;&amp;nbsp; a.id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; a.claim_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; a.icd9&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp; table_a a&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) a1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&lt;/P&gt;&lt;P&gt;&amp;nbsp; b.id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; b.claim_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; b.cpt&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&lt;/P&gt;&lt;P&gt;&amp;nbsp; table_b b&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) b1&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.id = b1.id&lt;/P&gt;&lt;P&gt;&amp;nbsp; and a1.claim_id = b1.claim_id;&lt;/P&gt;&lt;P&gt;group by&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.claim_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; a1.icd9&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 21:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184605#M46950</guid>
      <dc:creator>skillman</dc:creator>
      <dc:date>2015-02-26T21:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184606#M46951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doesn't sound like you want to "UPDATE" a table.&amp;nbsp; Sounds like you want to transpose the data.&lt;/P&gt;&lt;P&gt;SQL is not very good at that by it is easy to do in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; A ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id claim_id;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; B;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id claim_id cpt &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$5.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1 49999&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1 86945&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1 63664&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1 36598&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 1 64874&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;;;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (last.claim_id);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;merge&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; A B ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; id claim_id ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; n=sum(n,&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cpts $&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cpt1-cpt8 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; cpts(n)=cpt ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; CPT ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 00:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184606#M46951</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-27T00:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184607#M46952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks skillman! Based on your hint, I found sas statement and tried codes as below. It works! &lt;/P&gt;&lt;P&gt;However, the observations in created table try2001 are more than observations in table a. &lt;/P&gt;&lt;P&gt;Is it correct? Is it supposed to have same number of rows? Is it because there are more than one row for same claim_id of same id in table b?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table try2001 as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *, case prc2001.cpt&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '100' then 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '200' then 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '300' then 3 &lt;/P&gt;&lt;P&gt;&amp;nbsp; when '400' then 4&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '500' then 5&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '600' then 6 &lt;/P&gt;&lt;P&gt;&amp;nbsp; when '700' then 7&lt;/P&gt;&lt;P&gt;&amp;nbsp; when '800' then 8&lt;/P&gt;&lt;P&gt;&amp;nbsp; end as procedure&lt;/P&gt;&lt;P&gt;&amp;nbsp; from a&lt;/P&gt;&lt;P&gt;&amp;nbsp; left join b&lt;/P&gt;&lt;P&gt;&amp;nbsp; on a.id = b.id and a.claim_id = b.claim_id;&lt;/P&gt;&lt;P&gt;quit; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 01:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184607#M46952</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-27T01:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184608#M46953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the records duplicates? If so add distinct into the select query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct (then name the column names)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know if this works for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-shawn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 15:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184608#M46953</guid>
      <dc:creator>skillman</dc:creator>
      <dc:date>2015-02-27T15:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184609#M46954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks skillman!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to keep all columns in table a, but want to get unique records based on 4 variables id, claim_id, cpt, claim_date. (BTW, I am not sure if I could use claim_date directly in sql, as it is date variable). In this case, I do not know how to deal the select distinct, *, and these 4 variables together. Could anyone give me some hints? Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184609#M46954</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-27T16:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184610#M46955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then how to deal with duplicates in data step or sql? I need consider 4 variables: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;id, claim_id, cpt, claim_date&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184610#M46955</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-02-27T16:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184611#M46956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can just explicitly call out the column names:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct&lt;/P&gt;&lt;P&gt;a.id,&lt;/P&gt;&lt;P&gt;a.claim_id,&lt;/P&gt;&lt;P&gt;a.claim_date,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;b.cpt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 16:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184611#M46956</guid>
      <dc:creator>skillman</dc:creator>
      <dc:date>2015-02-27T16:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: update a table by another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184612#M46957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;What are you actually trying to accomplish?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Do you want to make a list of the CPT codes for a particular patients claim?&amp;nbsp; The code I posted should do that.&amp;nbsp; If the claim has multiple dates then you might want to adjust the BY variable list so that you could have multiple observations per claim.&amp;nbsp; But perhaps you don't care about the multiple dates.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Do you want to count the number of claims that have a particular CPT code?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2015 17:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/update-a-table-by-another-table/m-p/184612#M46957</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-02-27T17:01:43Z</dc:date>
    </item>
  </channel>
</rss>

