<?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: sas reference to a numeric variable name in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495575#M6204</link>
    <description>&lt;P&gt;This works. Many, many thanks.&lt;/P&gt;&lt;P&gt;What is the precise function of the suffix "n"?&lt;/P&gt;&lt;P&gt;Is this topic (var name options, numerical var names in SAS Studio) covered anywhere in the instructions manual or the online help?&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Zlerman&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2018 04:29:25 GMT</pubDate>
    <dc:creator>zlerman</dc:creator>
    <dc:date>2018-09-14T04:29:25Z</dc:date>
    <item>
      <title>sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495405#M6201</link>
      <description>&lt;P&gt;I have imported an xlsx file in which columns have numerical names, e.g., 11003, 21003, 21103, and so on (more than 200 variables). The file imported correctly and I see the var names as 11003, 21003, 21103 in the output window and in the proc contents output. However, when I refer to my variables as 11003, 21003, 21103, etc., the SAS Studio does not recognize the variable names and produces an error message. I cannot run even a simple SAS program such as data a; set b; if 21103 eq 0; run; Variables with nonnumerical (character) names are recognized correctly, but if I try to print a mix of variables with nonnumerical and numerical names I get an error:&lt;/P&gt;&lt;DIV class="sasSource"&gt;proc print data=coops.full2015; var ОКПО ОКВЭД 11103;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_____&lt;/DIV&gt;&lt;DIV class="sasError"&gt;22&lt;/DIV&gt;&lt;DIV class="sasError"&gt;200&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Enclosing the numerical var name in quotation marks does not help: the same error is produced.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Please tell me how to access the variables with numerical names in my file.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT size="3" face="arial,helvetica,sans-serif" color="#000000"&gt;Putting the numerical var name in quotes does not help: &lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;DIV class="sasSource"&gt;proc print data=coops.full2015; var ОКПО ОКВЭД "11103"; run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_______&lt;/DIV&gt;&lt;DIV class="sasError"&gt;22&lt;/DIV&gt;&lt;DIV class="sasError"&gt;200&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, ;, -, /, :, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;Please help me to access the variables with numerical names in my file.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;Thank you for your cooperation.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Sep 2018 17:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495405#M6201</guid>
      <dc:creator>zlerman</dc:creator>
      <dc:date>2018-09-13T17:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495408#M6202</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Try something like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any validmemname=extend;

proc print data=coops.full2015; 
  var ОКПО ОКВЭД '11103'n;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the letter n used with the numeric column name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS® 9.4 and SAS® Viya® 3.4 Programming Documentation / SAS Language Reference: Concepts&lt;BR /&gt;Rules for SAS Variable Names&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p18cdcs4v5wd2dn1q0x296d3qek6.htm&amp;amp;locale=en#n0nfuxt1u6y9jin120gszztjh00o" target="_blank"&gt;https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p18cdcs4v5wd2dn1q0x296d3qek6.htm&amp;amp;locale=en#n0nfuxt1u6y9jin120gszztjh00o&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 17:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495408#M6202</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-09-13T17:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495575#M6204</link>
      <description>&lt;P&gt;This works. Many, many thanks.&lt;/P&gt;&lt;P&gt;What is the precise function of the suffix "n"?&lt;/P&gt;&lt;P&gt;Is this topic (var name options, numerical var names in SAS Studio) covered anywhere in the instructions manual or the online help?&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Zlerman&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 04:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495575#M6204</guid>
      <dc:creator>zlerman</dc:creator>
      <dc:date>2018-09-14T04:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495639#M6205</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The letter "n" is used to distinguish between a quoted string and a name literal value.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The link that I posted earlier explains this.&amp;nbsp; This link is for the "SAS Name LIterals" section in the same Web page:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p18cdcs4v5wd2dn1q0x296d3qek6.htm&amp;amp;locale=en#n0qc68k2iyhs5kn1t2bvt41myhn1" target="_blank"&gt;https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lrcon&amp;amp;docsetTarget=p18cdcs4v5wd2dn1q0x296d3qek6.htm&amp;amp;locale=en#n0qc68k2iyhs5kn1t2bvt41myhn1&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 11:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495639#M6205</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-09-14T11:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495661#M6208</link>
      <description>&lt;P&gt;Thanks much. All is much clearer now, including the terminology ("name literals") and the system options that you have suggested.&lt;/P&gt;&lt;P&gt;Best.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 12:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/sas-reference-to-a-numeric-variable-name/m-p/495661#M6208</guid>
      <dc:creator>zlerman</dc:creator>
      <dc:date>2018-09-14T12:58:03Z</dc:date>
    </item>
  </channel>
</rss>

