<?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 set a Macro that Renames Variable Names? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124522#M25478</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the data was all in the same order then you could use PROC SQL Union all or Insert into and the names would be taken from the first file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from (&lt;/P&gt;&lt;P&gt;select * from table1&lt;/P&gt;&lt;P&gt;union all&lt;/P&gt;&lt;P&gt;select * from table2) a;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Mar 2013 16:37:02 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-03-01T16:37:02Z</dc:date>
    <item>
      <title>How to set a Macro that Renames Variable Names?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124519#M25475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So lets say if there are six excel files all containing similar variables names and their own observations, ie. in one excel file the variable name might be &lt;STRONG&gt;&lt;EM&gt;Payor&lt;/EM&gt; &lt;EM&gt;Name, Name ID, Assigned Code&lt;/EM&gt;&lt;/STRONG&gt;, where the other excel might say &lt;STRONG&gt;&lt;EM&gt;Original Payor Name, Original ID, Proc Code &lt;/EM&gt;&lt;/STRONG&gt;and the third excel might say &lt;EM&gt;&lt;STRONG&gt;Original Payer Name, Original Name ID, Code&lt;/STRONG&gt;. &lt;/EM&gt;All have similar variable names that represents the same thing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now, I've successfully imported them into SAS and I want to rename the variable names so that they all have a standardized name, i.e. &lt;STRONG&gt;&lt;EM&gt;Payor Name, Payor ID, Code &lt;/EM&gt;&lt;/STRONG&gt;and because I am working with six excel files, I thought that it may be conveninet to write a macro that renames all the variable names, and this is where I am currently stuck on...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to SAS and understand the basics of macro and rename but combining them is my problem even though I feel like it is do-able. please help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 23:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124519#M25475</guid>
      <dc:creator>new810</dc:creator>
      <dc:date>2013-02-28T23:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a Macro that Renames Variable Names?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124520#M25476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubt that a macro would add much value to this situation.&amp;nbsp; Unless it was an Excel macro that you gave out to the people supplying you with the data so that the files would be consistently formatted.&lt;/P&gt;&lt;P&gt;Just type the code into your editor and copy and paste it five more times and adjust for the differences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt; set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; one (rename = ('Payor Name'n = payor&amp;nbsp; "Name ID"n = name "Assigned Code"n = code ))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; two (rename = ('Original Payor Name'n = payor&amp;nbsp; "Original ID"n = name "Proc Code"n = code ))&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 01:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124520#M25476</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-01T01:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a Macro that Renames Variable Names?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124521#M25477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom, I guess it is easier to do it that way.. than setting a macro. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 16:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124521#M25477</guid>
      <dc:creator>new810</dc:creator>
      <dc:date>2013-03-01T16:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a Macro that Renames Variable Names?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124522#M25478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the data was all in the same order then you could use PROC SQL Union all or Insert into and the names would be taken from the first file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select * from (&lt;/P&gt;&lt;P&gt;select * from table1&lt;/P&gt;&lt;P&gt;union all&lt;/P&gt;&lt;P&gt;select * from table2) a;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 16:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124522#M25478</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-03-01T16:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a Macro that Renames Variable Names?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124523#M25479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza, I will give that idea a try. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 17:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-set-a-Macro-that-Renames-Variable-Names/m-p/124523#M25479</guid>
      <dc:creator>new810</dc:creator>
      <dc:date>2013-03-01T17:07:20Z</dc:date>
    </item>
  </channel>
</rss>

