<?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 Delete spaces in unknown variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390561#M93713</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following my topic of yesterday:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/proc-import-excel-sheet/m-p/390276#M93589" target="_self"&gt;https://communities.sas.com/t5/Base-SAS-Programming/proc-import-excel-sheet/m-p/390276#M93589&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have another choice than importing an excel sheet with column names as equals to the first row of my sheet.&lt;/P&gt;&lt;P&gt;The two major problems are:&lt;/P&gt;&lt;P&gt;- the first row can change from one sheet to another then the column names also&lt;/P&gt;&lt;P&gt;- some column names have spaces &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can manage the first problem by looking for column names with&amp;nbsp;sashelp.vcolumn&lt;/P&gt;&lt;P&gt;The second is more complex. I think I can, but it's an hard work because I need to use names in several ways, transposing, aggregating,...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to replace all spaces by this: _ for all variables of a table (whatever they are) without naming them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2017 11:23:46 GMT</pubDate>
    <dc:creator>FP12</dc:creator>
    <dc:date>2017-08-24T11:23:46Z</dc:date>
    <item>
      <title>Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390561#M93713</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following my topic of yesterday:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/proc-import-excel-sheet/m-p/390276#M93589" target="_self"&gt;https://communities.sas.com/t5/Base-SAS-Programming/proc-import-excel-sheet/m-p/390276#M93589&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have another choice than importing an excel sheet with column names as equals to the first row of my sheet.&lt;/P&gt;&lt;P&gt;The two major problems are:&lt;/P&gt;&lt;P&gt;- the first row can change from one sheet to another then the column names also&lt;/P&gt;&lt;P&gt;- some column names have spaces &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can manage the first problem by looking for column names with&amp;nbsp;sashelp.vcolumn&lt;/P&gt;&lt;P&gt;The second is more complex. I think I can, but it's an hard work because I need to use names in several ways, transposing, aggregating,...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to replace all spaces by this: _ for all variables of a table (whatever they are) without naming them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 11:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390561#M93713</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-24T11:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390565#M93717</link>
      <description>&lt;P&gt;Set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=v7;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as described here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/engfedsrv/70118/HTML/default/viewer.htm#p1ffkpdm6kbjawn1wvfpgzuzjcbg.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/engfedsrv/70118/HTML/default/viewer.htm#p1ffkpdm6kbjawn1wvfpgzuzjcbg.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 11:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390565#M93717</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-08-24T11:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390567#M93718</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when using proc import with getnames=yes SAS get rid of the spaces in the name and inserts underscore, so I don't get what's the problem here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if sometimes your data contain the names in first row and sometimes not, you should try identify the sheets having names and those without and import separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to automate the whole thing I think you have no other solution than importing the whole document twice, one time with yes and one time with no.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without test data and approximation of the number of sheets/frequency it's difficult to say what's best.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 11:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390567#M93718</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-08-24T11:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390572#M93722</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;&amp;nbsp;but it's an hard work because" - the answer to this is because you are forced to use a very poor data source. &amp;nbsp;No matter what you do, or what you program, it will never be a stable efficient process if the input is not. &amp;nbsp;Whenever I get this scenario, after pushing back, then I resort to other methods, for instance:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"Well, due to the nature of the source, the programming will take X hours longer (costing xyz), and the ongoing cost per unit (i.e. import) would be xyz for maintenance"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Its amazong how things get changed when you lay it out like that.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 12:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390572#M93722</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-24T12:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390612#M93735</link>
      <description>&lt;P&gt;Wooh you just saved my life, nothing less! Thanks.&lt;/P&gt;&lt;P&gt;I was trying to find a difficult solution and in one line you solve my problem...&lt;/P&gt;&lt;P&gt;I feel so stupid right now ^^&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 13:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390612#M93735</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-24T13:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390615#M93736</link>
      <description>&lt;P&gt;I don't deny it...&lt;/P&gt;&lt;P&gt;But the house values are to ask for better quality but find an alternative while waiting for it.&lt;/P&gt;&lt;P&gt;So as you say, I'm forced to use &amp;nbsp;poor quality &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 13:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390615#M93736</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-24T13:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete spaces in unknown variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390822#M93801</link>
      <description>&lt;P&gt;Anytime, glad to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 05:51:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Delete-spaces-in-unknown-variables/m-p/390822#M93801</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-08-25T05:51:12Z</dc:date>
    </item>
  </channel>
</rss>

