<?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: Renaming variables that don't have a space to have a space in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186286#M47308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use ods tagsets.excelxp and proc report.&amp;nbsp; You have lots of functionality for layout, labels, styling etc.&lt;/P&gt;&lt;P&gt;Alternatively write a datastep which outputs the data as you want to CSV (which Excel can read). &lt;/P&gt;&lt;P&gt;I can only think of one reason - using a old style Office binary format is small - for using export, and even that nowadays is questionable. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 10:26:44 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-01-16T10:26:44Z</dc:date>
    <item>
      <title>Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186285#M47307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello - I have a request to change all of the variable names for a report that I created. I will be using proc export to Excel to distribute the report. Is there a way to change variable names to include spaces?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;rename NbrOfAccts = 'Number Of New Accts'n; - This didn't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Old Variable&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;New Variable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;NbrOfNewAccts&lt;/SPAN&gt; = &lt;SPAN style="color: #0000ff;"&gt;Number Of New Accts&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 10:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186285#M47307</guid>
      <dc:creator>SasGuy614</dc:creator>
      <dc:date>2015-01-16T10:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186286#M47308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use ods tagsets.excelxp and proc report.&amp;nbsp; You have lots of functionality for layout, labels, styling etc.&lt;/P&gt;&lt;P&gt;Alternatively write a datastep which outputs the data as you want to CSV (which Excel can read). &lt;/P&gt;&lt;P&gt;I can only think of one reason - using a old style Office binary format is small - for using export, and even that nowadays is questionable. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 10:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186286#M47308</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-16T10:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186287#M47309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use &lt;STRONG&gt;&amp;nbsp; options validvarname=any ;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for your purpose I would like add a label for the variable , and use LABEL option in proc export&amp;nbsp; to direct its label into excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 10:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186287#M47309</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-16T10:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186288#M47310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried this a few times and I'm still not having success.The variable&amp;nbsp; 'NbrOfNewHhlds' is the same after I run and export via proc export to Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I interpreted your recommendation correctly...below is what I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;options validvarname=any;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;* Export to Excel - Exporting each chart to a separate tab */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;%macro P1_C1 (dmob,dname);&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA= FINAL.P1_C1_MOB_&amp;amp;DMOB._&amp;amp;DNAME._&amp;amp;ReportDate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile= "/opt/apps/sas/MKT/PCG/New_Hhld_Activity_YTD/Final/PRIVATE_BANKING_HHLD_REPORT_&amp;amp;ReportDate.TEST.xlsx" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=xlsx replace;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label NbrOfNewHhlds = 'Number of New HHs'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="MOB_&amp;amp;DMOB.";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%Mend P1_C1;&lt;/P&gt;&lt;P&gt;%P1_C1 (0,,HH);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 21:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186288#M47310</guid>
      <dc:creator>SasGuy614</dc:creator>
      <dc:date>2015-01-20T21:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186289#M47311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to apply the label to the data set and then use proc export. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use either a data step or proc datasets to change the label before the export.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 22:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186289#M47311</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-20T22:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186290#M47312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Am I missing something obvious. In the first part below I used your suggestion to rename but when I use the proc export, the column name is still in its original format. I don't use the label option often. If you have suggestions or links where I can read please feel free to provide so that I can get up-to-speed with the rest of the SAS community &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options validvarname=any;&lt;/P&gt;&lt;P&gt;%macro P1_C1 (dmob,dname);&lt;/P&gt;&lt;P&gt;data TEST;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set FINAL.P1_C1_MOB_&amp;amp;DMOB._&amp;amp;DNAME._&amp;amp;ReportDate.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label NbrOfNewHhlds = 'Number of New HHs';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%Mend P1_C1;&lt;/P&gt;&lt;P&gt;%P1_C1 (0,HH);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Export to Excel - Exporting each chart to a seperate tab */&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA= TEST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile= "/opt/apps/sas/MKT/PCG/New_Hhld_Activity_YTD/Final/PRIVATE_BANKING_HHLD_REPORT_&amp;amp;ReportDate.TEST.xlsx" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=xlsx replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="TEST_DATA";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 03:32:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186290#M47312</guid>
      <dc:creator>SasGuy614</dc:creator>
      <dc:date>2015-01-21T03:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186291#M47313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't have the label option in proc export. &lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000316288.htm" title="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000316288.htm"&gt;Base SAS(R) 9.2 Procedures Guide&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 03:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186291#M47313</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-01-21T03:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186292#M47314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need label it before proc export , and don't forget the label option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro P1_C1 ;&lt;/P&gt;&lt;P&gt;data TEST;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label name = 'Number of New HHs';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%Mend P1_C1;&lt;/P&gt;&lt;P&gt;%P1_C1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Export to Excel - Exporting each chart to a seperate tab */&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA= TEST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile= "c:\temp\xyz.xls"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=excel replace label;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="TEST_DATA";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="x.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/8806_x.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 04:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186292#M47314</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-21T04:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming variables that don't have a space to have a space</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186293#M47315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks....this seems to work. My follow-up question is that I have the label option within proc rank. However the two variables that I am ranking I need to modify their variable names as well. I really don't want to created another data set for the label option. Is there a dynamic way to label them within proc rank?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I export the column names for the two variables listed below, it produces the following below. Ideally I would like for them to be labeled what I highlighted in black. &lt;/P&gt;&lt;P&gt;a) Rank for Variable TtlDeposit_InvBal&lt;/P&gt;&lt;P&gt;b) Rank for Variable TtlDeposit_InvBal_LoanBal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc rank descending data=P1_C1 out=LABEL_TEST;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;TtlDeposit_InvBal&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;TtlDeposit_InvBal_LoanBal&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ranks &lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Dep_Inv_Rank&lt;/STRONG&gt; &lt;STRONG&gt;Dep_Inv_Loan_Rank&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label MonthOpened = 'Month Opened';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label NbrOfNewHhlds = '# of New HHs';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label NewDDAHhlds = '# of New DDA HHs';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 16:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Renaming-variables-that-don-t-have-a-space-to-have-a-space/m-p/186293#M47315</guid>
      <dc:creator>SasGuy614</dc:creator>
      <dc:date>2015-01-21T16:26:44Z</dc:date>
    </item>
  </channel>
</rss>

