<?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: referencing dataset columns with spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24620#M4189</link>
    <description>SAS "name constants"&lt;BR /&gt;
They have an N suffix in the way that date constants have a D suffix.&lt;BR /&gt;
&lt;BR /&gt;
Try:[pre]data test ;&lt;BR /&gt;
   keep "First Name"n ;&lt;BR /&gt;
run ;[/pre]&lt;BR /&gt;
Also, have a look at system option VALIDVARNAME and SAS/Access to RDBMS documentation&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
PeterC</description>
    <pubDate>Tue, 10 Jun 2008 19:34:06 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-06-10T19:34:06Z</dc:date>
    <item>
      <title>referencing dataset columns with spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24619#M4188</link>
      <description>I have an excel file I imported into a SAS dataset. The problem is the excel file column names had spaces. Now the sas dataset columns have the spaces in them too. How do I reference these columns? Also how can I rename them? I tried using quotes in the example below, but got errors trying to run this code. &lt;BR /&gt;
&lt;BR /&gt;
current dataset: &lt;BR /&gt;
First Name          Last Name&lt;BR /&gt;
....                      ....&lt;BR /&gt;
....                      ....&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
keep "First Name";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
the above code produces an error. it seems SAS doesn't like the quotes around the column name. &lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance!</description>
      <pubDate>Tue, 10 Jun 2008 19:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24619#M4188</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-10T19:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: referencing dataset columns with spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24620#M4189</link>
      <description>SAS "name constants"&lt;BR /&gt;
They have an N suffix in the way that date constants have a D suffix.&lt;BR /&gt;
&lt;BR /&gt;
Try:[pre]data test ;&lt;BR /&gt;
   keep "First Name"n ;&lt;BR /&gt;
run ;[/pre]&lt;BR /&gt;
Also, have a look at system option VALIDVARNAME and SAS/Access to RDBMS documentation&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
PeterC</description>
      <pubDate>Tue, 10 Jun 2008 19:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24620#M4189</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-10T19:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: referencing dataset columns with spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24621#M4190</link>
      <description>When you import the excel files into SAS, most invalid (in the sense of SAS, like space, $, -, etc ) characters were replaced with _ (under score). Your &lt;I&gt;&lt;B&gt;First Name&lt;/B&gt;&lt;/I&gt; in excel will become &lt;I&gt;&lt;B&gt;First_Name&lt;/B&gt;&lt;/I&gt; in SAS. You may be viewing the data file with Column Label. Change to Column Name in data viewer.&lt;BR /&gt;
You could retain the same variable names with&lt;BR /&gt;
&lt;BR /&gt;
options VALIDVARNAME=ANY ; (only in BASE and STAT)</description>
      <pubDate>Tue, 24 Jun 2008 21:09:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/referencing-dataset-columns-with-spaces/m-p/24621#M4190</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-24T21:09:20Z</dc:date>
    </item>
  </channel>
</rss>

