<?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: Getting values from Date_range Prompt using do-while in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300048#M312253</link>
    <description>&lt;P&gt;The macro language is a text processing language, and comparisons will be text comparisons, meaning that the string "02jan2016"d will be considered "bigger" than "01may2016"d!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would be better off if you stored the raw date values (days from 01jan1960) with format z5. (creating leading zeroes) into your "macro date" variables.&lt;/P&gt;
&lt;P&gt;Another trick would be to create a list of dates in a data step, and use call execute to call a macro doing the work for each date.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 07:58:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-09-22T07:58:27Z</dc:date>
    <item>
      <title>Getting values from Date_range Prompt using do-while</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300045#M312252</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've created Date_range Prompt named "range".&lt;/P&gt;&lt;P&gt;My goal is to reach values between range_min and range_max using do while loop in macro. I can get values using intnx function inside data step, but i want to use values in several data steps and proc sql's in macro.&lt;/P&gt;&lt;P&gt;Here is the shorter version of my code and the problem is that my code doesn't stop at value of range_max:&lt;/P&gt;&lt;PRE&gt;%_eg_conditional_dropds(WORK.base_all);

%macro radi;

%let temp=&amp;amp;range_min;
%let limit=&amp;amp;range_max;

%put temp=&amp;amp;temp;
%put limit=&amp;amp;limit;

%do %while("&amp;amp;temp"d&amp;lt;"&amp;amp;limit"d);

%_eg_conditional_dropds(WORK.test);
data test;
format now limit date9.; 
now=intnx('day',"&amp;amp;temp"d,1);
limit="&amp;amp;limit"d;
call symput('temp', put(now,date9.));
run;

proc append base=work.base_all data=test; quit;

%end;
%mend;

%radi&lt;/PRE&gt;&lt;P&gt;Example: if i want date range between 01Sep2016 and 30Sep2016, this program stops at 31Oct2016.&lt;/P&gt;&lt;P&gt;I use SAS EG 7.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 07:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300045#M312252</guid>
      <dc:creator>tino86</dc:creator>
      <dc:date>2016-09-22T07:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting values from Date_range Prompt using do-while</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300048#M312253</link>
      <description>&lt;P&gt;The macro language is a text processing language, and comparisons will be text comparisons, meaning that the string "02jan2016"d will be considered "bigger" than "01may2016"d!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would be better off if you stored the raw date values (days from 01jan1960) with format z5. (creating leading zeroes) into your "macro date" variables.&lt;/P&gt;
&lt;P&gt;Another trick would be to create a list of dates in a data step, and use call execute to call a macro doing the work for each date.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 07:58:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300048#M312253</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-22T07:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting values from Date_range Prompt using do-while</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300651#M312254</link>
      <description>Try&lt;BR /&gt;%while( %sysevalf("&amp;amp;temp"d&amp;lt;"&amp;amp;limit"d) )&lt;BR /&gt;&lt;BR /&gt;The sysevalf() function will cope with converting date constants&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Sep 2016 21:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300651#M312254</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2016-09-25T21:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting values from Date_range Prompt using do-while</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300717#M312255</link>
      <description>Tnx Peter_C,&lt;BR /&gt;this is what i was looking for..</description>
      <pubDate>Mon, 26 Sep 2016 09:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Getting-values-from-Date-range-Prompt-using-do-while/m-p/300717#M312255</guid>
      <dc:creator>tino86</dc:creator>
      <dc:date>2016-09-26T09:30:59Z</dc:date>
    </item>
  </channel>
</rss>

