<?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: concatenating tables with multiple rename statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738709#M28905</link>
    <description>Thank you so much! You answered my question and it is helpful.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
    <pubDate>Mon, 03 May 2021 20:44:33 GMT</pubDate>
    <dc:creator>knighsson</dc:creator>
    <dc:date>2021-05-03T20:44:33Z</dc:date>
    <item>
      <title>concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738692#M28901</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;Hello! &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;I have a question about concatenating tables with multiple rename statement. Could you please confirm the syntax of the first way is accurate or not?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;in addition, can the second way to code get the same results from the first way to code?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;Thank you!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;First:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; nh.diabetes_4yr;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;set&lt;/SPAN&gt; NH.DIQ_c&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;NH.DIQ_d (&lt;SPAN class="s2"&gt;rename&lt;/SPAN&gt;=(DID040=DID040Q)&amp;nbsp;&lt;SPAN class="s2"&gt;rename&lt;/SPAN&gt;=(DID060=DID060G)&amp;nbsp;&lt;SPAN class="s2"&gt;rename&lt;/SPAN&gt;=(DID070=DIQ070));&lt;/P&gt;
&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s3"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p2"&gt;&lt;STRONG&gt;&lt;SPAN class="s3"&gt;Second:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; nh.diabetes_4yr;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;set&lt;/SPAN&gt; NH.DIQ_c&lt;/P&gt;
&lt;P class="p1"&gt;NH.DIQ_d (&lt;SPAN class="s2"&gt;rename&lt;/SPAN&gt;=(DID040=DID040Q));&lt;/P&gt;
&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s3"&gt;; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; nh.diabetes_4yr;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;set&lt;/SPAN&gt; NH.DIQ_c&lt;/P&gt;
&lt;P class="p1"&gt;NH.DIQ_d (&lt;SPAN class="s2"&gt;rename&lt;/SPAN&gt;=(DID060=DID060G));&lt;/P&gt;
&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s3"&gt;; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p4"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; nh.diabetes_4yr;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;set&lt;/SPAN&gt; NH.DIQ_c&lt;/P&gt;
&lt;P class="p1"&gt;NH.DIQ_d (&lt;SPAN class="s2"&gt;rename&lt;/SPAN&gt;=(DID070=DIQ070));&lt;/P&gt;
&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s3"&gt;; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738692#M28901</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2021-05-03T20:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738699#M28902</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nh.diabetes_4yr;
    set NH.DIQ_c 
    NH.DIQ_d (rename=(DID040=DID040Q DID060=DID060G DID070=DIQ070));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second way also requires some changes, and is pretty inefficient, I would do it as above.&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:29:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738699#M28902</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-03T20:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738706#M28903</link>
      <description>&lt;P&gt;Not really sure what you question is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you have multiple variables in ONE data set to rename you can save a lot of typing and possible confusion with parentheses by using multiple pairs in a single rename grouping such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datasetname (rename=(oldname1=newname1&amp;nbsp; oldname2=newname2 oldname3=newname3)).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code doesn't throw an error but requires lots of extra typing with the ever present more typing=&amp;gt; more chances to make a typo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your "Second" method overwrites the same output data set two times and only the effect of the last data step will have one variable renamed. The third iteration of nh.diabetes_4yr would have both DID040 and DID060 from the NH.DIQ_d data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 20:40:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738706#M28903</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-03T20:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738708#M28904</link>
      <description>Thank you, I thought the second way may overwrite the nh.diabetes_4yr. So I want to double check.&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;</description>
      <pubDate>Mon, 03 May 2021 20:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738708#M28904</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2021-05-03T20:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738709#M28905</link>
      <description>Thank you so much! You answered my question and it is helpful.&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Mon, 03 May 2021 20:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738709#M28905</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2021-05-03T20:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738710#M28906</link>
      <description>&lt;P&gt;The first method works but it is much more verbose than what is needed. Just list all of the old=new pairs in a single RENAME= list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data nh.diabetes_4yr;
  set
    NH.DIQ_c 
    NH.DIQ_d (rename=(DID040=DID040Q DID060=DID060G DID070=DIQ070))
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second method cannot work since each step is overwriting the target dataset.&amp;nbsp; Only the results of the final data step will be available.&lt;/P&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>Mon, 03 May 2021 20:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738710#M28906</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-03T20:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating tables with multiple rename statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738732#M28908</link>
      <description>&lt;P&gt;Thank you for your help!&lt;/P&gt;
&lt;P&gt;It totally makes sense to me now.&lt;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 22:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/concatenating-tables-with-multiple-rename-statement/m-p/738732#M28908</guid>
      <dc:creator>knighsson</dc:creator>
      <dc:date>2021-05-03T22:29:29Z</dc:date>
    </item>
  </channel>
</rss>

