<?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: Range as a variable in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159845#M2934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ERROR: Not all variables from the list '9'n-'24'n have been found&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jun 2014 21:11:35 GMT</pubDate>
    <dc:creator>Thyl</dc:creator>
    <dc:date>2014-06-28T21:11:35Z</dc:date>
    <item>
      <title>Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159834#M2923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i have one column named 9-24 . Is there a way to use is in a "keep" statement? I'm new to SAS and all the ways I tried failed as it's considered a range from 9 to 24.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 19:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159834#M2923</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T19:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159835#M2924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to import variable from other source into SAS? Can you please show log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 19:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159835#M2924</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-28T19:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159836#M2925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just merging 2 datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 19:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159836#M2925</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T19:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159837#M2926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So variable name is 9-24 and this is in SAS dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 19:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159837#M2926</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-28T19:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159838#M2927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 19:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159838#M2927</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T19:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159839#M2928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the error message? Variable name does not conform to SAS naming conventions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 20:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159839#M2928</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-28T20:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159840#M2929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ERROR 214-322: Variable name 19 is not valid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was imported from excell.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 20:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159840#M2929</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T20:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159841#M2930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"9-24" is the label of the imported variable. It is not a valid SAS variable name, so it was replaced with "__24" (two underscores). You can use (keep=__24). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 20:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159841#M2930</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-06-28T20:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159842#M2931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can change variable name in excel then do that. SAS variable name must begin with a letter (A-Z, either uppercase or lowercase) or an underscore (_).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 20:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159842#M2931</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-28T20:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159843#M2932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Didn't work. I'm using" options validvarname=any" if that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 20:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159843#M2932</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T20:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159844#M2933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KEEP '9'n-'24'n. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 21:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159844#M2933</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-28T21:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159845#M2934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ERROR: Not all variables from the list '9'n-'24'n have been found&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 21:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159845#M2934</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T21:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159846#M2935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try double dash instead of single dash. If that doesn't work, please post the results from proc contents on your dataset. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=have; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 21:12:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159846#M2935</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-28T21:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159847#M2936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="Bez tytułu.bmp" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6740_Bez tytułu.bmp" width="450" /&gt;&lt;IMG alt="Bez tytułu2.bmp" class="jive-image" src="https://communities.sas.com/legacyfs/online/6741_Bez tytułu2.bmp" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 21:41:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159847#M2936</guid>
      <dc:creator>Thyl</dc:creator>
      <dc:date>2014-06-28T21:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159848#M2937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep '19-24'n&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wrap each variable you want to keep in a single quote followed by an n. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'VARIABLE'n &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 21:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159848#M2937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-28T21:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Range as a variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159849#M2938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The names in your table work.edu don't comply with SAS naming conventions. &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x296d3qek6.htm" style="font-size: 10pt; line-height: 1.5em;" title="http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x296d3qek6.htm"&gt;SAS(R) 9.3 Language Reference: Concepts, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With"validvarname=any" you still can define such variable names in your tables but you need to quote them as literals everywhere in your code in the form: '0-2'n &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also made the experience that some of the SAS Enterprise Guide wizards don't quote such variable names so with such names you can end up that wizard generated code doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is best to always use variable names which comply with the SAS naming standards. If you're using the EG import wizard then select the option (tick-box) which automatically converts non-complying variable names to complying ones during imports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have already a data set from somewhere else then I would suggest you rename the variables. For your example you could use syntax as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc datasets lib=work nolist;&lt;/P&gt;&lt;P&gt;&amp;nbsp; modify edu;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rename &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '0-2'n&amp;nbsp;&amp;nbsp;&amp;nbsp; =_0_2 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '13-15'n&amp;nbsp; =_13_15 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; label &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _0_2&amp;nbsp;&amp;nbsp;&amp;nbsp; = '0-2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _13_15&amp;nbsp; = '13-15'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; contents data=edu;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 00:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Range-as-a-variable/m-p/159849#M2938</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-06-29T00:54:30Z</dc:date>
    </item>
  </channel>
</rss>

