<?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: Variable names with &amp;quot;:&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400615#M97128</link>
    <description>&lt;P&gt;Options validvarname=any should work here - but I agree, change it to a "normal" SAS name ASAP e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;

data test(rename=("Data Var:id"n=DataVarid));
	set sashelp.class;
	"Data Var:id"n=1;;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 03 Oct 2017 15:16:22 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2017-10-03T15:16:22Z</dc:date>
    <item>
      <title>Variable names with ":"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400579#M97119</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be greatefull if anyone could help me with ':' in variable name.&amp;nbsp; When I import from excel files I ve got var names like 'Data var: id'n while I can manage(drop, keep, rename) with names without ':' exemple&amp;nbsp; 'Data var name'n, I can`t do anything with first one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 13:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400579#M97119</guid>
      <dc:creator>Matt3</dc:creator>
      <dc:date>2017-10-03T13:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names with ":"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400582#M97121</link>
      <description>&lt;P&gt;Unfortunately your a bit stuck.&amp;nbsp; : means any variable with a prefix of.&amp;nbsp; However this is not generally the case with Excel.&amp;nbsp; Let me explain, first Excel is a really poor data medium.&amp;nbsp; As you are finding, there is no real rules on what goes into a spreadsheet, so you "varaible" names could be anything, even pictures.&amp;nbsp; Now for SAS to try to work with this mess, they give you the option of referring to variables (we will call it that, but in Excel terms it is the first cells contents) using named literals, or, look for this text in the box.&amp;nbsp; Behind the scenes SAS creates a SAS compliant name for it by stripping spaces, special characters and fixing length.&lt;/P&gt;
&lt;P&gt;Simple solution, don't use Excel - it really does cause so many problems.&lt;/P&gt;
&lt;P&gt;More difficult solution, either know the names and put them in by hand, or use a bit of code to get the variable names, and then work with that - be prepared for your code to fail at each run as Excel "names" change though.&lt;/P&gt;
&lt;P&gt;E.g.&lt;/P&gt;
&lt;PRE&gt;proc sql;
  select NAME
  into   :VLIST separated by ' '
  from   SASHELP.VCOLUMN
  where  LIBNAME="YOURLIB"
     and MEMNAME="YOURDS";
quit;&lt;BR /&gt;&lt;BR /&gt;* Use&lt;BR /&gt;data want;&lt;BR /&gt;  set yourlib.yourds (keep=&amp;amp;vlist.);&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Oct 2017 13:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400582#M97121</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-03T13:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names with ":"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400591#M97125</link>
      <description>&lt;P&gt;use the following option to get legal variable name of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=v7 ;
proc import ............&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Oct 2017 13:53:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400591#M97125</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-03T13:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names with ":"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400615#M97128</link>
      <description>&lt;P&gt;Options validvarname=any should work here - but I agree, change it to a "normal" SAS name ASAP e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any;

data test(rename=("Data Var:id"n=DataVarid));
	set sashelp.class;
	"Data Var:id"n=1;;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Oct 2017 15:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400615#M97128</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-10-03T15:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Variable names with ":"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400658#M97144</link>
      <description>&lt;P&gt;If you set the OPTION VALIDVARNAME=V7 before you import the data, SAS will automatically convert the variable name to a valid SAS name and keep the name as a label.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can then rename it if you want and I suspect that's really the easiest fix.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 16:59:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-names-with-quot-quot/m-p/400658#M97144</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-03T16:59:30Z</dc:date>
    </item>
  </channel>
</rss>

