<?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: proc import from excel data name has spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570310#M160802</link>
    <description>&lt;P&gt;Change the setting of the VALIDVARNAME option and SAS should automatically convert those types of column headers into valid names.&lt;/P&gt;
&lt;P&gt;If you leave VALIDVARNAME=ANY then you can use name literals in your code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rename 'real gdp'n=Real_GDP&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Jul 2019 15:51:29 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-01T15:51:29Z</dc:date>
    <item>
      <title>proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570295#M160792</link>
      <description>&lt;P&gt;Dear Sas community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question. When I use proc import to load an excel sheet, the column name in my excel sheet has spaces (for example, one variable name is "Real GDP").&lt;/P&gt;&lt;P&gt;I can successfully import the excel sheet into my sas. The problem is that in sas datset, the variable name also have spaces.&lt;/P&gt;&lt;P&gt;It prevents me from doing any analysis/coding.&lt;/P&gt;&lt;P&gt;Do you know any way to rename (for example, I want to change "Real GDP" to "Real_GDP" in sas)&lt;/P&gt;&lt;P&gt;I don't want to do it manually in excel because in excel there are hundreds of names to rename.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 15:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570295#M160792</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2019-07-01T15:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570306#M160800</link>
      <description>&lt;P&gt;Using proc import should automatically import data and put underscores in the variable names where there are spaces. The spaces that you see are probably a Format. Double click a variable and look at the name of the variable in the popup. You can look at all the variables with Proc Contents. Let me know if those still have spaces.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 15:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570306#M160800</guid>
      <dc:creator>Tommy1</dc:creator>
      <dc:date>2019-07-01T15:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570310#M160802</link>
      <description>&lt;P&gt;Change the setting of the VALIDVARNAME option and SAS should automatically convert those types of column headers into valid names.&lt;/P&gt;
&lt;P&gt;If you leave VALIDVARNAME=ANY then you can use name literals in your code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rename 'real gdp'n=Real_GDP&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jul 2019 15:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570310#M160802</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-01T15:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570559#M160901</link>
      <description>thank you for your reply, Tom. Appreciate it. Yes, strangely, the variable name still has spaces... I'm also surprised it doesn't automatically add underscore... maybe my setting is different from default?</description>
      <pubDate>Tue, 02 Jul 2019 13:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570559#M160901</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2019-07-02T13:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570560#M160902</link>
      <description>worked like charm! thanks!</description>
      <pubDate>Tue, 02 Jul 2019 13:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570560#M160902</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2019-07-02T13:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570561#M160903</link>
      <description>&lt;P&gt;Check what you have.&amp;nbsp; For variable names check VALIDVARNAME.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(getoption(validvarname));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it is ANY then PROC IMPORT will&amp;nbsp; allow spaces in names.&lt;/P&gt;
&lt;P&gt;If it is V7 then PROC IMPORT should convert the names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For dataset names check the VALIDMEMNAME option instead.&lt;/P&gt;
&lt;P&gt;If it is COMPAT then it should convert the dataset names.&lt;/P&gt;
&lt;P&gt;If it is EXTEND then it should allow spaces in the dataset names.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 13:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570561#M160903</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-02T13:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570563#M160905</link>
      <description>learned a ton! thanks!!! Really appreciate it.</description>
      <pubDate>Tue, 02 Jul 2019 13:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/570563#M160905</guid>
      <dc:creator>changxuosu</dc:creator>
      <dc:date>2019-07-02T13:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc import from excel data name has spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/653876#M196403</link>
      <description>&lt;P&gt;I have been facing the same issue. After importing dataset using proc import, sas does not auto converting space into underscore when column name has space in it. Is there any options that i need to specify first.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 07:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-from-excel-data-name-has-spaces/m-p/653876#M196403</guid>
      <dc:creator>bodkhesudam</dc:creator>
      <dc:date>2020-06-06T07:47:00Z</dc:date>
    </item>
  </channel>
</rss>

