<?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 Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456391#M115589</link>
    <description>&lt;P&gt;Thank you for your response, do I apply&amp;nbsp;&lt;SPAN&gt;VALIDVARNAME=ANY option in the proc&amp;nbsp;Transposes&amp;nbsp; command?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Apr 2018 03:41:13 GMT</pubDate>
    <dc:creator>Sasadomo</dc:creator>
    <dc:date>2018-04-23T03:41:13Z</dc:date>
    <item>
      <title>sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456345#M115573</link>
      <description>&lt;P&gt;I was using the following lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data =Weighted1 out =Weighted2
(rename = ( '1'n =ret_top '2'n=ret_bot) drop = _label_ );
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where I wanted to rename variable named "1"&amp;nbsp; and named "2"&amp;nbsp;in Weighted1 to "ret_tap" and "ret_bot" but SAS shows error for above line 2. How would Reference to such a variable?&lt;/P&gt;</description>
      <pubDate>Sun, 22 Apr 2018 23:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456345#M115573</guid>
      <dc:creator>Sasadomo</dc:creator>
      <dc:date>2018-04-22T23:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456349#M115576</link>
      <description>&lt;P&gt;To help us to help you, are you able to supply (sample) data &amp;amp; the actual log?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 00:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456349#M115576</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2018-04-23T00:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456354#M115577</link>
      <description>&lt;P&gt;Thank you for you reply&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want Weighted2 as this:&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="20180422212400.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20026i469BA113C6EA9E0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="20180422212400.png" alt="20180422212400.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And in weighted1 "1" "2" are the variable name&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the log&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 01:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456354#M115577</guid>
      <dc:creator>Sasadomo</dc:creator>
      <dc:date>2018-04-23T01:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456363#M115582</link>
      <description>&lt;P&gt;You don't show us what you're starting with, so it's still not clear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, when SAS Transposes variables it automatically names them (usually col1, col2 etc), and I strongly suspect the names are not 1 or 2, so you first need to find the output names. I would do so by running the PROC TRANSPOSE, seeing the output data set and then renaming the variables accordingly. You probably want to run PROC CONTENTS to get the names. In general, I prefer to turn off the VALIDVARNAME=ANY option so I don't get names like '1'n in the first place.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202368"&gt;@Sasadomo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want Weighted2 as this:&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="20180422212400.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20026i469BA113C6EA9E0B/image-size/large?v=v2&amp;amp;px=999" role="button" title="20180422212400.png" alt="20180422212400.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 23 Apr 2018 02:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456363#M115582</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-23T02:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456391#M115589</link>
      <description>&lt;P&gt;Thank you for your response, do I apply&amp;nbsp;&lt;SPAN&gt;VALIDVARNAME=ANY option in the proc&amp;nbsp;Transposes&amp;nbsp; command?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 03:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456391#M115589</guid>
      <dc:creator>Sasadomo</dc:creator>
      <dc:date>2018-04-23T03:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456394#M115591</link>
      <description>&lt;P&gt;No, it's a SAS option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I recommend:&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;It means SAS will default to valid SAS names, by replacing spaces with _ and adding _ before variables with a 1 or 2.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202368"&gt;@Sasadomo&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your response, do I apply&amp;nbsp;&lt;SPAN&gt;VALIDVARNAME=ANY option in the proc&amp;nbsp;Transposes&amp;nbsp; command?&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 03:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456394#M115591</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-23T03:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: sas reference to a numeric variable name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456409#M115599</link>
      <description>&lt;P&gt;Maxim 3: Know your data.&lt;/P&gt;
&lt;P&gt;Run the proc transpose without the rename, inspect the variable names in weighted2, and then rewrite the rename accordingly.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 06:20:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-reference-to-a-numeric-variable-name/m-p/456409#M115599</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-23T06:20:04Z</dc:date>
    </item>
  </channel>
</rss>

