<?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 SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751993#M236818</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let start_date=%sysevalf('28JUN2021'd) ; 
%let end_date=%sysevalf('04JUL2021'd) ;

/*Horizontal*/
data temp/view=temp ;
  array dates(&amp;amp;start_date:&amp;amp;end_date) (&amp;amp;start_date:&amp;amp;end_date) ;
  format dates: date9. ;
run;

/*Vertical*/
proc transpose data=temp out=want(drop=_name_ rename=(col1=date)) ;
  var dates: ;
run;

proc print noobs ;run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;date&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;28JUN2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;29JUN2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;30JUN2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;01JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;02JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;03JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;04JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sun, 04 Jul 2021 18:30:15 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2021-07-04T18:30:15Z</dc:date>
    <item>
      <title>series of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751944#M236793</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a series of dates from &amp;amp;start_date&amp;nbsp; till &amp;amp;end_date&lt;/P&gt;
&lt;P&gt;What is the reason that I don't get it??&lt;/P&gt;
&lt;P&gt;In the result there is only one date&amp;nbsp;05JUL2021&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace" color="#000000"&gt;&lt;SPAN style="font-size: 14.4px; white-space: pre; background-color: #f5f2f0;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;%let start_date=28JUN2021;
%let end_date=04JUL2021;
data wanted;
    date="&amp;amp;start_date"d;
    do while (date&amp;lt;="&amp;amp;end_date"d);  
        date=intnx('day', date, 1, 's');
format date date9.; 
    end;
run;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 04:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751944#M236793</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-07-04T04:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751948#M236796</link>
      <description>&lt;P&gt;you have use output statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start_date=28JUN2021; %let end_date=04JUL2021;
data wanted; 
date="&amp;amp;start_date"d; 
do while (date &amp;lt;"&amp;amp;end_date"d); 
date=intnx('day', date, 1, 's'); 
output;
format date date9.; end; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Jul 2021 07:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751948#M236796</guid>
      <dc:creator>singhsahab</dc:creator>
      <dc:date>2021-07-04T07:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751950#M236797</link>
      <description>&lt;P&gt;You missed the output statement. Because SAS dates are just a count of days since 1/1/1960 you even don't need the intnx() function for this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start_date=28JUN2021;
%let end_date=04JUL2021;

data wanted;
  format date date9.;
  do date="&amp;amp;start_date"d to "&amp;amp;end_date"d;
    output;
  end;
  stop;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Jul 2021 07:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751950#M236797</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-04T07:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751953#M236800</link>
      <description>&lt;P&gt;You really, really, really need to start understanding the basic mechanics of the data step.&lt;/P&gt;
&lt;P&gt;In the absence of an explicit OUTPUT statement, the data step compiler will code a single output at the "end" of the step. If there is implicit looping, caused by the presence of INFILE/INPUT (for external files) or SET/MERGE/UPDATE (for datasets), you will have one output at the end of every iteration of the step.&lt;/P&gt;
&lt;P&gt;Since you do not read any data, there is only one iteration; since there also is no explicit OUTPUT statement, one single output will be performed, with the value of date that caused the termination of the DO WHILE loop.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 08:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751953#M236800</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-04T08:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: series of dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751993#M236818</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let start_date=%sysevalf('28JUN2021'd) ; 
%let end_date=%sysevalf('04JUL2021'd) ;

/*Horizontal*/
data temp/view=temp ;
  array dates(&amp;amp;start_date:&amp;amp;end_date) (&amp;amp;start_date:&amp;amp;end_date) ;
  format dates: date9. ;
run;

/*Vertical*/
proc transpose data=temp out=want(drop=_name_ rename=(col1=date)) ;
  var dates: ;
run;

proc print noobs ;run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;date&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;28JUN2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;29JUN2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;30JUN2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;01JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;02JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;03JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;04JUL2021&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 04 Jul 2021 18:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/series-of-dates/m-p/751993#M236818</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-07-04T18:30:15Z</dc:date>
    </item>
  </channel>
</rss>

