<?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: Working with Dates and Times in SAS (Tutorial) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477876#M123160</link>
    <description>&lt;P&gt;What have you tried so far?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you investigated functions such as INTNX, HOLIDAY, HOLIDAYNAME, HOLIDAYTEST&amp;nbsp;or WEEKDAY?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The HOLIDAY, HOLIDAYNAME, HOLIDAYTEST&amp;nbsp;functions may or may not help depending on your locale as the function by default works with common United States and Canadian Holidays though Proc Datekeys and the EVENTDS option is one way to add "custom" holidays not supported by the Holiday functions by default.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jul 2018 14:36:15 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-07-13T14:36:15Z</dc:date>
    <item>
      <title>Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477859#M123150</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data with a single date column and want to create another date column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Condition:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the value in the provided date column is either Sunday or Holiday as per my company's list&amp;nbsp; or 1st and 2nd Saturday&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which is also a holiday in our company then i want the next date which is a working day in my new date column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 14:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477859#M123150</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-13T14:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Dates and Times in SAS (Tutorial)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477876#M123160</link>
      <description>&lt;P&gt;What have you tried so far?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you investigated functions such as INTNX, HOLIDAY, HOLIDAYNAME, HOLIDAYTEST&amp;nbsp;or WEEKDAY?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The HOLIDAY, HOLIDAYNAME, HOLIDAYTEST&amp;nbsp;functions may or may not help depending on your locale as the function by default works with common United States and Canadian Holidays though Proc Datekeys and the EVENTDS option is one way to add "custom" holidays not supported by the Holiday functions by default.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 14:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477876#M123160</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-13T14:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Dates and Times in SAS (Tutorial)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477936#M123172</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using intnx function with&amp;nbsp;weekday1w option like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;next_date = intnx('weekday1w',fr_date,1,'S');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&amp;nbsp;the result would be for all other days except sunday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but how should i proceed if the value in the date column contains &amp;nbsp;either 1st and 2nd saturday or a holiday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can share the logic along with the syntax that would be of great help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 15:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477936#M123172</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-13T15:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Dates and Times in SAS (Tutorial)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477940#M123175</link>
      <description>&lt;P&gt;Unfortunately this isn't that straightforward. There are some interesting options, such as custom functions, but one way is illustrated here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Generating_Holiday_Lists" target="_blank"&gt;http://www.sascommunity.org/wiki/Generating_Holiday_Lists&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 16:12:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477940#M123175</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-13T16:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Dates and Times in SAS (Tutorial)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477941#M123176</link>
      <description>&lt;P&gt;Thanks a lot for the document. I will look into it , try it once and will post my outcome.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 16:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477941#M123176</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-13T16:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477945#M123178</link>
      <description>&lt;P&gt;You can try something like this, I wasn't sure what you wanted if the date did not meet your criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; tday = &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(today());&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; &lt;STRONG&gt;&lt;I&gt;custom&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%global&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; custom1 custom2 custom3 custom4 custom5 custom6 custom7 sat1 sat2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'03feb2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom2=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'10apr2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom3=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'15may2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom4=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'23jul2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom5=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'30aug2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom6=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'19oct2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;custom7=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'21dec2018'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;sat1=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'week'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&amp;amp;tday,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'begin'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'end'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;sat2=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'week'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&amp;amp;tday,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'begin'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'end'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom1,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom2,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom3'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom3,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom4'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom4,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom5'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom5,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom6'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom6,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'custom7'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(custom7,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'sat1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(sat1,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;call symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'sat2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(sat2,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)); &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; custom;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;custom&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; xxxx;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;03may2018&lt;/P&gt;&lt;P&gt;06may2018&lt;/P&gt;&lt;P&gt;08jul2018&lt;/P&gt;&lt;P&gt;19oct2018&lt;/P&gt;&lt;P&gt;30aug2018&lt;/P&gt;&lt;P&gt;31aug2018&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; zzzz (drop=q cust);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; xxxx;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;q=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; weekday(date)=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; cust=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom2"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom3"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom4"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom5"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom6"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;custom7"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;sat1"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"&amp;amp;sat2"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; input(cust,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)=date &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; new_date=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'weekday'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,date,+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New"&gt;else&lt;/FONT&gt; new_date=intnx(&lt;FONT color="#800080" face="Courier New" size="3"&gt;'weekday'&lt;/FONT&gt;,date,+&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=zzzz;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; date new_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;mmddyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Obs date new_date&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Obs date new_date &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;05/03/2018&lt;/TD&gt;&lt;TD&gt;05/04/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;05/06/2018&lt;/TD&gt;&lt;TD&gt;05/07/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;05/30/2018&lt;/TD&gt;&lt;TD&gt;05/31/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;07/08/2018&lt;/TD&gt;&lt;TD&gt;07/09/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;10/19/2018&lt;/TD&gt;&lt;TD&gt;10/22/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;08/30/2018&lt;/TD&gt;&lt;TD&gt;08/31/2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;08/31/2018&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;09/03/2018&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ignore below...not sure how to remove&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRIKE&gt;1&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;05/03/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;.&lt;/STRIKE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRIKE&gt;2&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;05/06/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;05/07/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRIKE&gt;3&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;07/08/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;07/09/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRIKE&gt;4&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;10/19/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;10/22/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRIKE&gt;5&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;08/30/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;08/31/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRIKE&gt;6&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;08/31/2018&lt;/STRIKE&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRIKE&gt;.&lt;/STRIKE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Jul 2018 13:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477945#M123178</guid>
      <dc:creator>EEng</dc:creator>
      <dc:date>2018-07-16T13:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477946#M123179</link>
      <description>Sorry the Saturday function are not working correctly.</description>
      <pubDate>Fri, 13 Jul 2018 16:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477946#M123179</guid>
      <dc:creator>EEng</dc:creator>
      <dc:date>2018-07-13T16:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477950#M123180</link>
      <description>&lt;P&gt;Thanks for the program..Give me a day . Let me try...Hope it works!! ....&lt;/P&gt;&lt;P&gt;By the way you guys are amazing!!!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 16:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477950#M123180</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-13T16:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477952#M123182</link>
      <description>Corrected the Sat1 and Sat2</description>
      <pubDate>Fri, 13 Jul 2018 17:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/477952#M123182</guid>
      <dc:creator>EEng</dc:creator>
      <dc:date>2018-07-13T17:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478100#M123240</link>
      <description>&lt;P&gt;Thanks for the code..... It is amazing..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want some more help from you..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;new_date value for 30th may and 31st Aug is coming blank&amp;nbsp; so instead of that can i have a next day value like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for 30th may 2018 the new_date = 31st may 2018 as its a working day&amp;nbsp;&lt;/P&gt;&lt;P&gt;for 31st aug 2018 the new_date =&amp;nbsp;3rd&amp;nbsp;september 2018 which is a working day after 1st sept and 2nd sept which&lt;/P&gt;&lt;P&gt;are 1st saturday and Sunday respectively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also can you please explain the logic which you have made using if then and do statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again thanks in advance.&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>Sat, 14 Jul 2018 08:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478100#M123240</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-14T08:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478282#M123338</link>
      <description>&lt;P&gt;Guys...Please suggest something...&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 05:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478282#M123338</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-16T05:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478355#M123370</link>
      <description>&lt;P&gt;Hello, like I said earlier I wasn't sure what you wanted to do if it did not meet your criteria. You add this line after:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; q&amp;gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; new_date=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'weekday'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,date,+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; new_date=intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'weekday'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,date,+&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Code has been updated. This should get you what you needed.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 13:28:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478355#M123370</guid>
      <dc:creator>EEng</dc:creator>
      <dc:date>2018-07-16T13:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478410#M123384</link>
      <description>&lt;P&gt;Here is my code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data xxxx;&lt;/P&gt;&lt;P&gt;input date date9.;&lt;BR /&gt;format date date9.;&lt;/P&gt;&lt;P&gt;datalines;&lt;BR /&gt;08JUL2018&lt;BR /&gt;09JUL2018&lt;BR /&gt;30AUG2018&lt;BR /&gt;21DEC2018&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data zzzz (drop=cust);&lt;BR /&gt;set xxxx;&lt;/P&gt;&lt;P&gt;J = 0;&lt;/P&gt;&lt;P&gt;new_time = date;&lt;/P&gt;&lt;P&gt;do While(J = 0);&lt;/P&gt;&lt;P&gt;if put(new_time,date9.) in&lt;BR /&gt;('30AUG2018'&lt;BR /&gt;,'21DEC2018',&lt;/P&gt;&lt;P&gt;,'15AUG2018'&lt;/P&gt;&lt;P&gt;,'16AUG2018'&lt;BR /&gt;)&lt;BR /&gt;then new_time = intnx('day',new_time,+1);&lt;BR /&gt;else if weekday(new_time)=1 then new_time=intnx('day',new_time,+1);&lt;BR /&gt;else J = 1;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;put new_time=;&lt;BR /&gt;put date=;&lt;/P&gt;&lt;P&gt;format new_time date9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The dates mentioned below are my holiday list which will go on increasing or will remain constant every year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if put(new_time,date9.) in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;('30AUG2018'&lt;BR /&gt;,'21DEC2018',&lt;/P&gt;&lt;P&gt;,'15AUG2018'&lt;/P&gt;&lt;P&gt;,'16AUG2018'&lt;BR /&gt;)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;then new_time = intnx('day',new_time,+1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it is not possible for me to write more and more values . So can we by somehow macrotise the code in if then else statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 16:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478410#M123384</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-16T16:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478489#M123398</link>
      <description>&lt;P&gt;Try this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your Holiday list can be an external file (SAS, csv, txt), it will always grow or constant&amp;nbsp;when you enter a new year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data holiday;
	 input date date9.;
	 datalines;
30AUG2018
21DEC2018
15AUG2018
16AUG2018
;
run;
data datain;
	 input date date9.;
	 datalines;
03may2018
06may2018
26may2018
30may2018
08jul2018
19oct2018
30aug2018
31aug2018
;
run;
%macro max(data=holiday);
	%global cnt;
	proc sql noprint;
		select count(*) into :OBScnt from &amp;amp;data;
	quit;
	%let cnt=&amp;amp;OBScnt;
%mend max;
%max;
run;
proc transpose data=holiday out=outdata (drop=_name_) prefix=dte;
run;
data test (drop=q i cust dte1-dte&amp;amp;cnt);
	 set datain;
	 if _n_=1 then set outdata;
	 q=0;
	 array hol{*} dte1-dte&amp;amp;cnt;
	 if weekday(date)=1 then q+1;
	 do i=1 to &amp;amp;cnt;
	 	if date=hol(i) then q+1;
	 end;
	 if q&amp;gt;0 then new_date=intnx('weekday',date,+1);
	 else new_date=intnx('weekday',date,+1);
run;
proc print data=test;
	 format date new_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Holiday will contain all your holidays.&lt;/P&gt;&lt;P&gt;Datain is your input file.&lt;/P&gt;&lt;P&gt;You can Transpose your Holiday file and apply it to every record (may not be the most efficient way)&lt;/P&gt;&lt;P&gt;Then apply your new_date logic. I thought you wanted the next Business day and not the day after? You can change this where you see fit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the above code, you should see this:&lt;/P&gt;&lt;DIV&gt;Obs date new_date &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;03MAY2018&lt;/TD&gt;&lt;TD&gt;04MAY2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;06MAY2018&lt;/TD&gt;&lt;TD&gt;07MAY2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;26MAY2018&lt;/TD&gt;&lt;TD&gt;28MAY2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;30MAY2018&lt;/TD&gt;&lt;TD&gt;31MAY2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;08JUL2018&lt;/TD&gt;&lt;TD&gt;09JUL2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;19OCT2018&lt;/TD&gt;&lt;TD&gt;22OCT2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;30AUG2018&lt;/TD&gt;&lt;TD&gt;31AUG2018&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;31AUG2018&lt;/TD&gt;&lt;TD&gt;03SEP2018&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Jul 2018 21:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478489#M123398</guid>
      <dc:creator>EEng</dc:creator>
      <dc:date>2018-07-16T21:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478598#M123429</link>
      <description>&lt;P&gt;Thank you so very much for your information and by considering your code as my reference i am done with my most of the logic....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 10:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478598#M123429</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-17T10:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478670#M123465</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211553"&gt;@VaibhavGhoghari&lt;/a&gt;&amp;nbsp;please mark&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/220719"&gt;@EEng&lt;/a&gt;&amp;nbsp;solution as correct, not your response.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 14:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/478670#M123465</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-07-17T14:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the next working day with a custom calendar</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/480126#M124054</link>
      <description>&lt;P&gt;Thanks for the suggestion ...actually my project requirement got changed at the end so according i went ahead with some other logic...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It wasn't different completely but took the reference from your code ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 07:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Finding-the-next-working-day-with-a-custom-calendar/m-p/480126#M124054</guid>
      <dc:creator>VaibhavGhoghari</dc:creator>
      <dc:date>2018-07-21T07:25:31Z</dc:date>
    </item>
  </channel>
</rss>

