<?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: Keep= Option With Range List of Variables ERROR in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keep-Option-With-Range-List-of-Variables-ERROR/m-p/311523#M67350</link>
    <description>&lt;P&gt;It's expecting a sequential sequence, ie date1, date2, date3 is specified as date1-date3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's not sequential, but the columns are side by side you can try a double dash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let criteria=(keep=M15201610--M30201602);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 14 Nov 2016 21:00:13 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-11-14T21:00:13Z</dc:date>
    <item>
      <title>Keep= Option With Range List of Variables ERROR</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-Option-With-Range-List-of-Variables-ERROR/m-p/311520#M67349</link>
      <description>&lt;P&gt;Here is some sample data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines;
  input Account Group M15201610 M15201611 M15201612 M30201601 M30201602;
  datalines;
1 1 0 2 2 2 .
0 0 1 2 2 2 .
3 3 0 3 1 2 1
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is what I'm trying to do:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let criteria=(keep=M15201610-M30201602);

data want;
  set have &amp;amp;criteria.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, I am getting the error:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Not all variables in the list M15201610-M30201602 were found.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;When I put the range of variables as (keep= M15201610-M15201612), it works perfectly fine. The reason I'm doing this keep list in the macro variable is because my real data has many of these M variables and I don't want to have to list them out one by one. They represent dates at the middle of the month and end of month for each year and month. So M15201610 would be October 15, 2016. Is there any way I can get around this error? (don't ask why the dates are labeled this way, I didn't come up with the naming convention).&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 20:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-Option-With-Range-List-of-Variables-ERROR/m-p/311520#M67349</guid>
      <dc:creator>JediApprentice</dc:creator>
      <dc:date>2016-11-14T20:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Keep= Option With Range List of Variables ERROR</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-Option-With-Range-List-of-Variables-ERROR/m-p/311523#M67350</link>
      <description>&lt;P&gt;It's expecting a sequential sequence, ie date1, date2, date3 is specified as date1-date3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's not sequential, but the columns are side by side you can try a double dash.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let criteria=(keep=M15201610--M30201602);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 21:00:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-Option-With-Range-List-of-Variables-ERROR/m-p/311523#M67350</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-14T21:00:13Z</dc:date>
    </item>
  </channel>
</rss>

