<?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: Incrementing the dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780483#M248699</link>
    <description>&lt;P&gt;Finally I developed the code for the my requests&amp;nbsp; and it is working fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let start=%eval(%sysfunc(today())-1);&lt;/P&gt;
&lt;P&gt;Code for Request 1 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 1&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 2 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code for Request 2 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 1&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 3 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Code for Request 3 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 2&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 3 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code for Request 4 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 1&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 1 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 16:08:10 GMT</pubDate>
    <dc:creator>vidyasagar1</dc:creator>
    <dc:date>2021-11-16T16:08:10Z</dc:date>
    <item>
      <title>Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779315#M248171</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;/* Input */;
DATA INPUT;
INFILE DATALINES;
INPUT MODEL $10.;
DATALINES;
735&amp;nbsp; &amp;nbsp;&amp;nbsp;
736&amp;nbsp; &amp;nbsp; &amp;nbsp;
737&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
777
775
772
773
787
797
747
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;looking for the output:&lt;/P&gt;&lt;P&gt;/* For the first two models Build_Date will be today's date and for next three models Build_Date will be tomorrow's and the trend will continue for next five. */;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Model&amp;nbsp; &amp;nbsp; &amp;nbsp;Build_Date&lt;/P&gt;&lt;P&gt;735&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;&lt;P&gt;736&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;&lt;P&gt;737&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/10/2021&amp;nbsp;&lt;/P&gt;&lt;P&gt;777&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;&lt;P&gt;775&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;&lt;P&gt;772&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;&lt;P&gt;773&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;&lt;P&gt;787&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/12/2021&lt;/P&gt;&lt;P&gt;797&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/12/2021&lt;/P&gt;&lt;P&gt;747&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 11/12/2021&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779315#M248171</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-09T12:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779316#M248172</link>
      <description>&lt;P&gt;Please help me with the dynamic SAS code. And the Build_Date should be weekday.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 12:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779316#M248172</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-09T12:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779323#M248177</link>
      <description>&lt;P&gt;Every day is a day of a week, so please define "weekday".&lt;/P&gt;
&lt;P&gt;This code creates your dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input model $10.;
datalines;
735    
736     
737       
777
775
772
773
787
797
747
;

%let start=%eval(%sysfunc(today())-1);

data want;
set have;
retain
  flag_3 0
  count 0
  build_date &amp;amp;start.
;
format build_date yymmdd10.;
if count = 0
then do;
  build_date + 1;
  count = 1 + flag_3;
  flag_3 = not flag_3;
end;
else count + (-1);
drop count flag_3;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 13:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779323#M248177</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-09T13:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779328#M248182</link>
      <description>&lt;P&gt;Hi, I am very happy for your quick reply. This code is working as expected for my request. Sorry I forgot to add few more points. The Build_Date should have only working days, means excludling Saturday's and Sunday's date and also the holiday's.&lt;/P&gt;&lt;P&gt;We will feed the list of Holidays.&lt;/P&gt;&lt;P&gt;Please help me with the SAS code including the above points also.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 13:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779328#M248182</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-09T13:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779331#M248185</link>
      <description>&lt;P&gt;So, you have a dataset containing dates of non-workdays. Make a list out of that, which you then use in a IN condition:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select holiday format=5. into :holidays separated by ","
from holidays;
quit;

data want;
set have;
retain
  flag_3 0
  count 0
  build_date &amp;amp;start.
;
format build_date yymmdd10.;
if count = 0
then do;
  do until (build_date not in(&amp;amp;holidays.) and weekday(build_date) not in (1,7));
    build_date + 1;
  end;
  count = 1 + flag_3;
  flag_3 = not flag_3;
end;
else count + (-1);
drop count flag_3;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 13:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779331#M248185</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-09T13:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779379#M248200</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;Could you also please help me to write a code for the below requests also ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request 1 :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;/* Input */;
DATA INPUT;
INFILE DATALINES;
INPUT MODEL $10.;
DATALINES;
735&amp;nbsp; &amp;nbsp;&amp;nbsp;
736&amp;nbsp; &amp;nbsp; &amp;nbsp;
737&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
777
775
772
773
787
797
747
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Expected Output: For the first two models today's date and next two model's tomorrow's date and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Model Build_Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;735&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;736&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;737&amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;777&amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;775&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;772&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;773&amp;nbsp; &amp;nbsp; 11/12/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;787&amp;nbsp; &amp;nbsp; 11/12/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;797&amp;nbsp; &amp;nbsp; 11/13/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;747&amp;nbsp; &amp;nbsp; 11/13/2021&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request 2 :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;/* Input */;
DATA INPUT;
INFILE DATALINES;
INPUT MODEL $10.;
DATALINES;
735&amp;nbsp; &amp;nbsp;&amp;nbsp;
736&amp;nbsp; &amp;nbsp; &amp;nbsp;
737&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
777
775
772
773
787
797
747
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Expected Output: For the first three models today's date and next three model's tomorrow's date and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Model Build_Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;735&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;736&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;737&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;777&amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;775&amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;772&amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;773&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;787&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;797&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;747&amp;nbsp; &amp;nbsp; 11/12/2021&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request 3 :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;/* Input */;
DATA INPUT;
INFILE DATALINES;
INPUT MODEL $10.;
DATALINES;
735&amp;nbsp; &amp;nbsp;&amp;nbsp;
736&amp;nbsp; &amp;nbsp; &amp;nbsp;
737&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
777
775
772
773
787
797
747
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Expected Output: For the first model today's date and next model day after tomorrow's date and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Model Build_Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;735&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;736&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;737&amp;nbsp; &amp;nbsp; 11/13/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;777&amp;nbsp; &amp;nbsp; 11/15/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;775&amp;nbsp; &amp;nbsp; 11/17/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;772&amp;nbsp; &amp;nbsp; 11/19/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;773&amp;nbsp; &amp;nbsp; 11/21/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;787&amp;nbsp; &amp;nbsp; 11/23/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;797&amp;nbsp; &amp;nbsp; 11/25/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;747&amp;nbsp; &amp;nbsp; 11/27/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request 4 :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;/* Input */;
DATA INPUT;
INFILE DATALINES;
INPUT MODEL $10.;
DATALINES;
735&amp;nbsp; &amp;nbsp;&amp;nbsp;
736&amp;nbsp; &amp;nbsp; &amp;nbsp;
737&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
777
775
772
773
787
797
747
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Expected Output: For the first model today's date and next model tomorrow's date and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Model Build_Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;735&amp;nbsp; &amp;nbsp; 11/09/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;736&amp;nbsp; &amp;nbsp; 11/10/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;737&amp;nbsp; &amp;nbsp; 11/11/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;777&amp;nbsp; &amp;nbsp; 11/12/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;775&amp;nbsp; &amp;nbsp; 11/13/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;772&amp;nbsp; &amp;nbsp; 11/14/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;773&amp;nbsp; &amp;nbsp; 11/15/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;787&amp;nbsp; &amp;nbsp; 11/16/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;797&amp;nbsp; &amp;nbsp; 11/17/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;747&amp;nbsp; &amp;nbsp; 11/18/2021&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 17:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779379#M248200</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-09T17:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779381#M248201</link>
      <description>&lt;P&gt;It's the same logic, with different offset value. You can&amp;nbsp;&lt;U&gt;easily&lt;/U&gt;&amp;nbsp;solve that on your own now.&lt;/P&gt;
&lt;P&gt;Like other muscles, an unused brain will atrophy.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 17:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779381#M248201</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-09T17:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779384#M248203</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let today=%sysfunc(today());
%let replication=2;
data want;
    set input;
    date=intnx('weekday17W',&amp;amp;today,floor((_n_-1)/&amp;amp;replication));
    format date mmddyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can change the value of &amp;amp;REPLICATION, right now it is set to 2, so every two observations will have the same date, and the next observation will be the next weekday. By changing &amp;amp;REPLICATION, you get most of what you have asked for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you set &amp;amp;REPLICATION to 2.5, the first 3 records will have the same date, and then the next 2 records will have the next weekday, and so on. If you want the first 2 records to have the same weekday, and then the next 3 records to have the same weekday, set &amp;amp;REPLICATION to 2.5 and then make the calculation of date via the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    date=intnx('weekday17W',&amp;amp;today,floor((_n_-1e-6)/&amp;amp;replication));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 18:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779384#M248203</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-09T18:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779519#M248275</link>
      <description>&lt;P&gt;Sorry. Thank you ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 08:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779519#M248275</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-10T08:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779521#M248277</link>
      <description>&lt;P&gt;Thanks a lot. This solution is working for me . &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 08:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/779521#M248277</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-10T08:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780360#M248642</link>
      <description>&lt;P&gt;Hi, sorry how to exclude the list of holidays also from that expression ?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 08:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780360#M248642</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-16T08:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780420#M248678</link>
      <description>&lt;P&gt;Hi, I am unable to solve it . Please help me with offset values for each of my query .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 13:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780420#M248678</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-16T13:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780428#M248683</link>
      <description>&lt;P&gt;Show us what you have tried, so we can point out where you erred.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 14:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780428#M248683</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-16T14:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780483#M248699</link>
      <description>&lt;P&gt;Finally I developed the code for the my requests&amp;nbsp; and it is working fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let start=%eval(%sysfunc(today())-1);&lt;/P&gt;
&lt;P&gt;Code for Request 1 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 1&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 2 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code for Request 2 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 1&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 3 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;Code for Request 3 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 2&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 3 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code for Request 4 :&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;retain&lt;BR /&gt;flag_3 1&lt;BR /&gt;count 0&lt;BR /&gt;build_date &amp;amp;start.&lt;BR /&gt;;&lt;BR /&gt;format build_date yymmdd10.;&lt;BR /&gt;if count = 0&lt;BR /&gt;then do;&lt;BR /&gt;do until (weekday(build_date) not in (1,7));&lt;BR /&gt;build_date + 1;&lt;BR /&gt;end;&lt;BR /&gt;count = 1 + (-flag_3);&lt;BR /&gt;/* flag_3 = not flag_3;*/&lt;BR /&gt;end;&lt;BR /&gt;else count + (-1);&lt;BR /&gt;/*drop count flag_3;*/&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780483#M248699</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-16T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780487#M248701</link>
      <description>&lt;P&gt;For this below request I am unable to develop the code.&lt;/P&gt;
&lt;P&gt;For first two models today's date and for next four models Build_date is incremented by 1, it has to follow same sequence for next 6 models.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New Request :&lt;/P&gt;
&lt;P&gt;/* Input */;&lt;BR /&gt;DATA INPUT;&lt;BR /&gt;INFILE DATALINES;&lt;BR /&gt;INPUT MODEL $10.;&lt;BR /&gt;DATALINES;&lt;BR /&gt;735 &lt;BR /&gt;736 &lt;BR /&gt;737 &lt;BR /&gt;777&lt;BR /&gt;775&lt;BR /&gt;772&lt;BR /&gt;773&lt;BR /&gt;787&lt;BR /&gt;797&lt;BR /&gt;747&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;Expected Output:&lt;/P&gt;
&lt;P&gt;Model Build_Date&lt;/P&gt;
&lt;P&gt;735 11/16/2021&lt;/P&gt;
&lt;P&gt;736 11/16/2021&lt;/P&gt;
&lt;P&gt;737 11/17/2021&lt;/P&gt;
&lt;P&gt;777 11/18/2021&lt;/P&gt;
&lt;P&gt;775 11/19/2021&lt;/P&gt;
&lt;P&gt;772 11/22/2021&lt;/P&gt;
&lt;P&gt;773 11/23/2021&lt;/P&gt;
&lt;P&gt;787 11/23/2021&lt;/P&gt;
&lt;P&gt;797 11/24/2021&lt;/P&gt;
&lt;P&gt;747 11/25/2021&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780487#M248701</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-16T16:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780495#M248703</link>
      <description>&lt;P&gt;Just use two nested DO loops.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA INPUT;
  INPUT MODEL $10.;
DATALINES;
735
736
737
777
775
772
773
787
797
747
;

data want;
  do build_date=today() by 1 ;
    do i=1 to 3;
      set input;
      output;
    end;
  end;
  format build_date yymmdd10.;
run;

proc print;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    build_date    i    MODEL

  1    2021-11-16    1     735
  2    2021-11-16    2     736
  3    2021-11-16    3     737
  4    2021-11-17    1     777
  5    2021-11-17    2     775
  6    2021-11-17    3     772
  7    2021-11-18    1     773
  8    2021-11-18    2     787
  9    2021-11-18    3     797
 10    2021-11-19    1     747
&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780495#M248703</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-16T16:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780497#M248705</link>
      <description>&lt;P&gt;Sorry, I have corrected my query. Please help me to write the code for my corrected query. It has to exclude weekends and list of holiday's which we provide.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780497#M248705</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-16T16:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780500#M248708</link>
      <description>&lt;P&gt;Just incorporate the logic to skip the holidays.&lt;/P&gt;
&lt;P&gt;For example if have a list of holidays in a dataset named HOLIDAYS (and the list is short enough to put into a macro variable) then something like this should work.&lt;/P&gt;
&lt;P&gt;Let's test it by pretending tomorrow is a holiday.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data holidays;
  holiday=today()+1;
run;

proc sql;
  select holiday into :holidays separated by ' '
  from holidays;
quit;

data want;
  do build_date=today() by 1 ;
    do build_date=build_date by 1
       while(build_date in (&amp;amp;holidays) or weekday(build_date) in (1 7));
    end;
    do i=1 to 3;
      set input;
      output;
    end;
  end;
  format build_date yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;Obs    build_date    i    MODEL

  1    2021-11-16    1     735
  2    2021-11-16    2     736
  3    2021-11-16    3     737
  4    2021-11-18    1     777
  5    2021-11-18    2     775
  6    2021-11-18    3     772
  7    2021-11-19    1     773
  8    2021-11-19    2     787
  9    2021-11-19    3     797
 10    2021-11-22    1     747

&lt;/PRE&gt;
&lt;P&gt;So you can see it skipped tomorrow and also the week-end.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 17:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780500#M248708</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-11-16T17:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780659#M248756</link>
      <description>&lt;P&gt;Hi, Thank you for trying to help me. But my expected output is like below :&lt;/P&gt;
&lt;P&gt;For the first two models today's date and for next four models incrementing the date by 1 and so on. Also should not consider weekends and list of holidays we provide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected Output:&lt;/P&gt;
&lt;P&gt;Model Build_Date&lt;/P&gt;
&lt;P&gt;735&amp;nbsp; &amp;nbsp; 11/16/2021&lt;/P&gt;
&lt;P&gt;736&amp;nbsp; &amp;nbsp; 11/16/2021&lt;/P&gt;
&lt;P&gt;737&amp;nbsp; &amp;nbsp; 11/17/2021&lt;/P&gt;
&lt;P&gt;777&amp;nbsp; &amp;nbsp; 11/18/2021&lt;/P&gt;
&lt;P&gt;775&amp;nbsp; &amp;nbsp; 11/19/2021&lt;/P&gt;
&lt;P&gt;772&amp;nbsp; &amp;nbsp; 11/22/2021&lt;/P&gt;
&lt;P&gt;773&amp;nbsp; &amp;nbsp; 11/23/2021&lt;/P&gt;
&lt;P&gt;787&amp;nbsp; &amp;nbsp; 11/23/2021&lt;/P&gt;
&lt;P&gt;797&amp;nbsp; &amp;nbsp; 11/24/2021&lt;/P&gt;
&lt;P&gt;747&amp;nbsp; &amp;nbsp; 11/25/2021&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 08:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780659#M248756</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-17T08:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Incrementing the dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780750#M248789</link>
      <description>&lt;P&gt;Hi All, please help me to write a code for this.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 14:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incrementing-the-dates/m-p/780750#M248789</guid>
      <dc:creator>vidyasagar1</dc:creator>
      <dc:date>2021-11-17T14:43:37Z</dc:date>
    </item>
  </channel>
</rss>

