<?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: series of dates in 1 day jumping in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614275#M179517</link>
    <description>&lt;P&gt;Your habit of using formatted date values causes you to stumble over your own feet.&lt;/P&gt;
&lt;P&gt;This&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date="&amp;amp;date_start";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;resolves to this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date="'01JUL2019'd";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which is not a valid SAS date literal.&lt;/P&gt;
&lt;P&gt;Simplify your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CurMon=1907;
data _null_;
date_start=mdy(mod(&amp;amp;CurMon,100),1,floor(&amp;amp;CurMon/100));
date_end=intnx ('month',date_start,0,'E');
counter = intck('month',date_start,date_end);
call symputx('date_start',date_start);
call symputx('date_end',date_end);
call symputx('n',put(counter,best.));
run;
%put &amp;amp;date_start.;
%put &amp;amp;date_end.;

data want_days;
do date = &amp;amp;date_start. to &amp;amp;date_end.;
    output;
end;
format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and take the time to study and internalize Maxim 28.&lt;/P&gt;</description>
    <pubDate>Sun, 29 Dec 2019 12:01:59 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-12-29T12:01:59Z</dc:date>
    <item>
      <title>series of dates in 1 day jumping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614261#M179506</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have the following&amp;nbsp; task.&lt;/P&gt;
&lt;P&gt;User define&amp;nbsp; year+month (for example: 1907 is July 2019).&lt;/P&gt;
&lt;P&gt;Then need to create a data set that contain all dates between start of 1907 and end of 1907.&lt;/P&gt;
&lt;P&gt;The dates in table should be char type with following structure&amp;nbsp; YYMMDD.&lt;/P&gt;
&lt;P&gt;So I need to create following values:&lt;/P&gt;
&lt;P&gt;190701&lt;/P&gt;
&lt;P&gt;190702&lt;/P&gt;
&lt;P&gt;190703&lt;/P&gt;
&lt;P&gt;190704&lt;/P&gt;
&lt;P&gt;190705&lt;/P&gt;
&lt;P&gt;.........&lt;/P&gt;
&lt;P&gt;.........&lt;/P&gt;
&lt;P&gt;190731&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I run this program and it run long time with no finish.&lt;/P&gt;
&lt;P&gt;What is the problem here please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CurMon=1907;
data _null_;
date_start=mdy(mod(&amp;amp;CurMon,100),1,floor(&amp;amp;CurMon/100));
date_end=intnx ('month',date_start,0,'E');
counter = intck('month',date_start,date_end);
/*call symputx('date_start',put(date_start,best.));*/
/*call symputx('date_end',put(date_end,best.));*/
call symputx('date_start',"'"||put(date_start,date9.)||"'d");
call symputx('date_end',"'"||put(date_end,date9.)||"'d");
call symputx('n',put(counter,best.));
run;
%put &amp;amp;date_start.;
%put &amp;amp;date_end.;


data want_days;
date="&amp;amp;date_start";
do while (date&amp;lt;="&amp;amp;date_end");
    output;
    date=intnx('day', date, 1, 's');
end;
format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 09:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614261#M179506</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-12-29T09:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates in 1 day jumping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614262#M179507</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this code, which is simpler:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CurMon=1902;

data want_days;
	date_start_n = mdy(input(substr(strip(&amp;amp;CurMon),3,2),2.),1,input(substr(strip(&amp;amp;CurMon),1,2),2.));
	date_end_n = intnx('month',date_start_n,0,'e');
	do date_n = date_start_n to date_end_n;
		date = strip(put(date_n,YYMMDD6.));
		output;
	end;
	drop date_start_n date_end_n date_n;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Dec 2019 10:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614262#M179507</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-29T10:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates in 1 day jumping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614263#M179508</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CurMon=1907;

data want;
 temp=input("&amp;amp;CurMon.01",yymmdd6.);
 do d=temp to intnx('month',temp,0,'e');
  date=put(d,yymmdd6.);output;
 end;
 keep date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Dec 2019 10:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614263#M179508</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-29T10:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates in 1 day jumping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614275#M179517</link>
      <description>&lt;P&gt;Your habit of using formatted date values causes you to stumble over your own feet.&lt;/P&gt;
&lt;P&gt;This&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date="&amp;amp;date_start";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;resolves to this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date="'01JUL2019'd";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which is not a valid SAS date literal.&lt;/P&gt;
&lt;P&gt;Simplify your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CurMon=1907;
data _null_;
date_start=mdy(mod(&amp;amp;CurMon,100),1,floor(&amp;amp;CurMon/100));
date_end=intnx ('month',date_start,0,'E');
counter = intck('month',date_start,date_end);
call symputx('date_start',date_start);
call symputx('date_end',date_end);
call symputx('n',put(counter,best.));
run;
%put &amp;amp;date_start.;
%put &amp;amp;date_end.;

data want_days;
do date = &amp;amp;date_start. to &amp;amp;date_end.;
    output;
end;
format date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and take the time to study and internalize Maxim 28.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2019 12:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates-in-1-day-jumping/m-p/614275#M179517</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-29T12:01:59Z</dc:date>
    </item>
  </channel>
</rss>

