<?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 Program to assist in identifying the same data collected in different datasets with inconsistent variable names in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17246#M3262</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Are the similar values in the same order in the datasets that you have examined? If so, there may be some hope of using one base dataset and renaming others based on order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Dec 2011 17:31:14 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2011-12-19T17:31:14Z</dc:date>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17242#M3258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to run the same program over many datasets which are similar but do not always use exactly the same variable names to collect the same data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. Age might be collected in all datasets but has a range of variable names: AGE, AGE1, AGE_NUM, CALCAG, AGNUM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a program I can run to assist me in identifying variables collecting the same data and applying a generic variable name?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, the label names are relatively consistent so maybe I can use these...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Stew&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS. Clearly, I am a SAS novice!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 03:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17242#M3258</guid>
      <dc:creator>stewartacraig</dc:creator>
      <dc:date>2011-12-19T03:21:43Z</dc:date>
    </item>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17243#M3259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One possibility would depend on the names of the other variables in your various datasets.&amp;nbsp; In your example, all of the age-like variables contained the string "AG".&amp;nbsp; If that is the case, and none of your other variables contain the string "AG" then you could write a small proc sql call that created a rename statement in a macro variable from the dictionary.columns view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us know if the above scenario might be a solution and, if it is, then I or someone can show you how you could write such a routine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 04:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17243#M3259</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-19T04:43:41Z</dc:date>
    </item>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17244#M3260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I can definitely use something like this to rename some/most of the variables (as in the AGE example) and some guidance on the code would be very useful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, there are other variable names where there may not be a unique string. I guess for these, I'll just have to manually identify and rename the variables on a case-by-case basis...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Stew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 04:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17244#M3260</guid>
      <dc:creator>stewartacraig</dc:creator>
      <dc:date>2011-12-19T04:56:47Z</dc:date>
    </item>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17245#M3261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data one;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ theage;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;John 25&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data two;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ myage;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Joe 25&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;data three;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name $ myage;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Mary 32&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro rename(filename);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let renames=;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select 'rename=('||trim(name)||'=age)'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :renames&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dictionary.columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where libname='WORK' and&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; memname=upcase("&amp;amp;filename.") and&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; index(upcase(name),'AG')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; data new_&amp;amp;filename.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &amp;amp;filename. (&amp;amp;renames.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend rename;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%rename(one)&lt;/P&gt;&lt;P&gt;%rename(two)&lt;/P&gt;&lt;P&gt;%rename(three)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 13:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17245#M3261</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-19T13:43:15Z</dc:date>
    </item>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17246#M3262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Are the similar values in the same order in the datasets that you have examined? If so, there may be some hope of using one base dataset and renaming others based on order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 17:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17246#M3262</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-12-19T17:31:14Z</dc:date>
    </item>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17247#M3263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi there. Unfortunately, the variable order is not always the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 21:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17247#M3263</guid>
      <dc:creator>stewartacraig</dc:creator>
      <dc:date>2011-12-19T21:58:31Z</dc:date>
    </item>
    <item>
      <title>Program to assist in identifying the same data collected in different datasets with inconsistent variable names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17248#M3264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks! I will implement this today and see how many variables I can rename.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 22:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Program-to-assist-in-identifying-the-same-data-collected-in/m-p/17248#M3264</guid>
      <dc:creator>stewartacraig</dc:creator>
      <dc:date>2011-12-19T22:00:08Z</dc:date>
    </item>
  </channel>
</rss>

