<?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 Assigning value to macro variable based on weekday to process data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379164#M91231</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to specify folder date in the program. I receive the data on Weekdays at night and run the program early next morning. So, the folder date is always like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Processing data on Tue &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-------------- &amp;nbsp; &amp;nbsp; Date of Mon&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Wed &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Tue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Thur &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Wed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Fri &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Thu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Mon &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Fri(Last) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*Facing problem in this one*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written macro variable where it reads in the previous data dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%LET FOLDER_NAME = %SYSFUNC(INTNX(WEEKDAY, %SYSFUNC(TODAY()),-1,E),&lt;/SPAN&gt;&lt;SPAN&gt;YYMMDDN8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, If I process the data on 20170725, the folder date would be 20170724. But how should I include logic in this one for processing data on Monday.&amp;nbsp;So, if the data is processed on monday of any given week, it should take in the date of last&amp;nbsp;friday.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chandan Mishra&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2017 18:24:37 GMT</pubDate>
    <dc:creator>CHAN07</dc:creator>
    <dc:date>2017-07-25T18:24:37Z</dc:date>
    <item>
      <title>Assigning value to macro variable based on weekday to process data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379164#M91231</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to specify folder date in the program. I receive the data on Weekdays at night and run the program early next morning. So, the folder date is always like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Processing data on Tue &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-------------- &amp;nbsp; &amp;nbsp; Date of Mon&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Wed &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Tue&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Thur &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Wed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Fri &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Thu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Processing data on Mon &amp;nbsp; &amp;nbsp; &amp;nbsp; -------------- &amp;nbsp; &amp;nbsp;Date of&amp;nbsp;Fri(Last) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/*Facing problem in this one*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written macro variable where it reads in the previous data dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%LET FOLDER_NAME = %SYSFUNC(INTNX(WEEKDAY, %SYSFUNC(TODAY()),-1,E),&lt;/SPAN&gt;&lt;SPAN&gt;YYMMDDN8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, If I process the data on 20170725, the folder date would be 20170724. But how should I include logic in this one for processing data on Monday.&amp;nbsp;So, if the data is processed on monday of any given week, it should take in the date of last&amp;nbsp;friday.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chandan Mishra&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 18:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379164#M91231</guid>
      <dc:creator>CHAN07</dc:creator>
      <dc:date>2017-07-25T18:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning value to macro variable based on weekday to process data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379172#M91235</link>
      <description>&lt;P&gt;Did you check the output? Using INTNX with the WEEKDAY should accomplish this, is it not? If so, post an example of how it isn't working.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2017 19:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379172#M91235</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-25T19:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning value to macro variable based on weekday to process data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379433#M91330</link>
      <description>&lt;P&gt;So, If I used this code for Monday 24th July, 2017, it is giving me value of 20170723. Rather I want the value to be &amp;nbsp;20170721 i.e. Friday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan Mishra&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 15:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379433#M91330</guid>
      <dc:creator>CHAN07</dc:creator>
      <dc:date>2017-07-26T15:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning value to macro variable based on weekday to process data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379436#M91332</link>
      <description>&lt;P&gt;The alignment parameter is messing up your calculation.&lt;/P&gt;
&lt;P&gt;Remove it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 59         
 60         %let testdate = '24Jul2017'd;
 61         %LET FOLDER_NAME = %SYSFUNC(INTNX(WEEKDAY, &amp;amp;testdate,-1),YYMMDDN8.);
 62         %put &amp;amp;folder_name.;
 20170721
 63         
 64         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 76    &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 15:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/379436#M91332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-26T15:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning value to macro variable based on weekday to process data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/384447#M91808</link>
      <description>&lt;P&gt;&amp;nbsp;Thank you so much for providing the solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandan Mishra&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 21:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-value-to-macro-variable-based-on-weekday-to-process/m-p/384447#M91808</guid>
      <dc:creator>CHAN07</dc:creator>
      <dc:date>2017-07-31T21:33:02Z</dc:date>
    </item>
  </channel>
</rss>

