<?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: Finding the actual name of a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345114#M79359</link>
    <description>&lt;P&gt;If proc import works under options validvarname=any, such names are possible in SAS. Use 'some funny name'n to adress them in code.&lt;/P&gt;
&lt;P&gt;Options validvarname=v7 forces proc import to use names that adhere to SAS naming standards.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2017 18:39:59 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-03-28T18:39:59Z</dc:date>
    <item>
      <title>Finding the actual name of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345111#M79358</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems like an odd questions, but I have imported some data into SAS EG and someof the column names have periods, slashes and parenthesis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;"A. Plasmodesmada"&lt;/P&gt;&lt;P&gt;"Ddimer (Ug/dL)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normaly, I would assume these are labels in explorer, but it looks like these are also the variable names. They also show up when I do proc contents. I know that SAS vairbales canot have periods or spaces in their names (for obvious reasons) so they must have different names. Any suggestions would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried running a proc contents where I keep the name, but it also shows them with spaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The import I used was the followng:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.RAW&lt;BR /&gt;DATAFILE= "C: user/ blah/blah/givemethedataplz/Data_030317.xlsx"&lt;BR /&gt;DBMS=xlsx REPLACE ;&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jack&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345111#M79358</guid>
      <dc:creator>jckbnimble</dc:creator>
      <dc:date>2017-03-28T18:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the actual name of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345114#M79359</link>
      <description>&lt;P&gt;If proc import works under options validvarname=any, such names are possible in SAS. Use 'some funny name'n to adress them in code.&lt;/P&gt;
&lt;P&gt;Options validvarname=v7 forces proc import to use names that adhere to SAS naming standards.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345114#M79359</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-28T18:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the actual name of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345120#M79360</link>
      <description>&lt;P&gt;I was trying to avoid having to recode a bit of hte variables (which is why I chose GETNAMES = YES or NO). validnames = v7 gives viable names for about 30 of the 100 or so variables, but recodes the rest at Var1-var100. Is it approprate to assume that I am stuck with manually entering in these values?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jack&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345120#M79360</guid>
      <dc:creator>jckbnimble</dc:creator>
      <dc:date>2017-03-28T18:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the actual name of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345135#M79367</link>
      <description>&lt;P&gt;Are you using both GETNAMES and the validvarname=v7 option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: answer to your original question, use proc contents.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=raw; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345135#M79367</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-28T19:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the actual name of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345170#M79381</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With VALIDVARNAME=ANY both of those work and the names are copied over to the variable NAME, warts and all. &amp;nbsp;So you will need to use name literals to refer to them by name. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use VARLIDVARNAME=V7 then for most values SAS&lt;SPAN&gt;&amp;nbsp;will replace invalid characters with underscores. &amp;nbsp;But for values like&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Ddimer (Ug/dL)" it will use VARx where X is the column number.&amp;nbsp;Not sure if it is the () or the / that SAS doesn't like. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The actual column header value will be stored in the LABEL. &amp;nbsp;But note&amp;nbsp;that if you happen to have duplicate column names then SAS will append _1, _2, ... &amp;nbsp;to make them distinct and this will impact both the LABEL and the NAME.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 20:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-actual-name-of-a-variable/m-p/345170#M79381</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-03-28T20:47:48Z</dc:date>
    </item>
  </channel>
</rss>

