<?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: Invalid name of variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778492#M247801</link>
    <description>&lt;P&gt;If you have the option setting of Validvarname=Any then things like proc import will allow non-standard names. These variable names must be used as a name literal which means the text enclosed in quotes followed by the letter n such as 'Var one'n .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally you can set the option Validvarname=V7; to prevent proc import from creating such names. The V7 option would create variable names with an underscore character, _ , in the place of any non-letter or non-digit character appearing in the data source as a variable name.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 14:08:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-11-04T14:08:42Z</dc:date>
    <item>
      <title>Invalid name of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778482#M247795</link>
      <description>&lt;P&gt;Hi, I imported an xls file (with a variable named ‘VAR ONE’) in a dataset work.test&lt;/P&gt;&lt;P&gt;I know that it is not a valid SAS name of variable.&lt;/P&gt;&lt;P&gt;In the dataset the name of the variable is still ‘VAR ONE’, and I can’t use it.&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data work.test2 (rename=([VAR ONE]= VAR_ONE));&lt;/P&gt;&lt;P&gt;Set work.test;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it doesn’t work.&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;Thank you all.&lt;/P&gt;&lt;P&gt;zaghini&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 13:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778482#M247795</guid>
      <dc:creator>Zaghini</dc:creator>
      <dc:date>2021-11-04T13:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid name of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778491#M247800</link>
      <description>&lt;P&gt;Set&amp;nbsp;&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;before your PROC IMPORT.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778491#M247800</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-04T14:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid name of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778492#M247801</link>
      <description>&lt;P&gt;If you have the option setting of Validvarname=Any then things like proc import will allow non-standard names. These variable names must be used as a name literal which means the text enclosed in quotes followed by the letter n such as 'Var one'n .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additionally you can set the option Validvarname=V7; to prevent proc import from creating such names. The V7 option would create variable names with an underscore character, _ , in the place of any non-letter or non-digit character appearing in the data source as a variable name.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 14:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778492#M247801</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-04T14:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid name of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778507#M247813</link>
      <description>&lt;P&gt;I did:&lt;/P&gt;&lt;P&gt;options validvarname=v7;&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE="/…/test.xls" OUT=work.vincolati DBMS=XLS REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SHEET="Quadratura collegati";&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but in xls file I've the variable 'Bilancio 2021' and in work.vincolati I still have the variable 'Bilancio 2021' instead 'Bilancio_2021' that I would expect with the options validvarname=v7.&lt;/P&gt;&lt;P&gt;where am I wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 15:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778507#M247813</guid>
      <dc:creator>Zaghini</dc:creator>
      <dc:date>2021-11-04T15:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid name of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778573#M247846</link>
      <description>&lt;P&gt;Run PROC CONTENTS. What you see may not be the variable name, but the label.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 18:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778573#M247846</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-04T18:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid name of variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778666#M247889</link>
      <description>&lt;P&gt;I’ve done it!&lt;/P&gt;&lt;P&gt;The problem was that I submitted sas code in separated steps:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Libname&lt;/LI&gt;&lt;LI&gt;options validvarname=v7;&lt;/LI&gt;&lt;LI&gt;proc import&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and does not work.&lt;/P&gt;&lt;P&gt;But if I do it in 2 steps (or 1) it works:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;select and submit libname&lt;/LI&gt;&lt;LI&gt;select and submit both options and import&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt; and &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 07:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-name-of-variable/m-p/778666#M247889</guid>
      <dc:creator>Zaghini</dc:creator>
      <dc:date>2021-11-05T07:17:20Z</dc:date>
    </item>
  </channel>
</rss>

