<?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: Automate IF-ELSE statement inside a macro. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212949#M39335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code produces following values when I ran your code without any change. Is it correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="137"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="59"&gt;filedd&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="78"&gt;filedd_new&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;14-01-01&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;********&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;14-06-06&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;********&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 May 2015 10:51:04 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2015-05-11T10:51:04Z</dc:date>
    <item>
      <title>Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212941#M39327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have a following code snippet, in which we keep adding an ELSE-IF statement whenever a new month starts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For example:&lt;/STRONG&gt; once the month of June will start, a new ELSE-&lt;SPAN style="font-size: 13.3333330154419px;"&gt;IF&lt;/SPAN&gt; condition will be added as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSE&lt;SPAN style="font-size: 13.3333330154419px;"&gt; IF &amp;amp;YYYYMMDD=20150531 THEN FILEDD=20150601;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;where:&lt;/STRONG&gt; YYYYMMDD will be the previous month's end date &amp;amp; FILEDD is the new month (here June) start date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to automate it &amp;amp; avoid adding the ELSE IF statement manually every month. Any suggestions are welcome. Thanks in advance &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call symputx('tt1',put(intnx('day',today(),-2),yymmddn8.),G);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;%macro DAILY_(YYYYMMDD);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data ORCL.BASE1&amp;amp;YYYYMMDD;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set MY_DIR.Daily_&amp;amp;YYYYMMDD.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;amp;YYYYMMDD='20141231'd THEN FILEDD='20150101'd;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;else IF &amp;amp;YYYYMMDD='20150131'd THEN FILEDD='20150201'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;else IF &amp;amp;YYYYMMDD='20150228'd THEN FILEDD='20150301'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;else IF &amp;amp;YYYYMMDD='20150331'd THEN FILEDD='20150401'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;else IF &amp;amp;YYYYMMDD='20150430'd THEN FILEDD='20150501'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSE FILEDD=FILEDD;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;%DAILY_(&amp;amp;tt1);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 07:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212941#M39327</guid>
      <dc:creator>KP12</dc:creator>
      <dc:date>2015-05-11T07:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212942#M39328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you want to set any date that is the last of a month to the first of the following month?&lt;/P&gt;&lt;P&gt;And the dates are stored as numbers in the way you posted, but not as SAS date values?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 07:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212942#M39328</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-11T07:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212943#M39329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try and change your macro to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro DAILY_(YYYYMMDD);&lt;/P&gt;&lt;P&gt;data ORCL.BASE1&amp;amp;YYYYMMDD;&lt;/P&gt;&lt;P&gt;set MY_DIR.Daily_&amp;amp;YYYYMMDD.;&lt;/P&gt;&lt;P&gt;FILEDD=PUT( INPUT("&amp;amp;YYMMDD", YYMMDD8.) + 1,YYMMDDN8.);&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 07:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212943#M39329</guid>
      <dc:creator>MichaelLarsen</dc:creator>
      <dc:date>2015-05-11T07:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212944#M39330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi KurtBremser,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is, suppose today is 1st June 2015 so whenever a new month will start, I'll add an else if statement like &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;ELSE&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt; IF &amp;amp;YYYYMMDD=20150531 THEN FILEDD=20150601;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333330154419px; font-style: inherit; background-color: #ffffff; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333330154419px; font-family: inherit;"&gt;&amp;amp; yes the numbers are stored in the format I have posted, these are not SAS date values.&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333330154419px; font-style: inherit; background-color: #ffffff; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 08:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212944#M39330</guid>
      <dc:creator>KP12</dc:creator>
      <dc:date>2015-05-11T08:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212945#M39331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, I will try with the code &amp;amp; update you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 08:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212945#M39331</guid>
      <dc:creator>KP12</dc:creator>
      <dc:date>2015-05-11T08:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212946#M39332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure why you even need a macro for that, seems to be pretty straight forward base SAS code, example:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format filedd yymmdd8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filedd="01JAN2014"d; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filedd="06JUN2014"d; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data daily_%sysfunc(today(),date9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format filedd_new yymmdd8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filedd_new=put(intnx('month',filedd,-1,"END"),yymmddn8.); /* Replace today() with your date value */&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 08:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212946#M39332</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-11T08:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212947#M39333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this in the data step:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int_date = intnx('month',input(put(filedd,8.),yymmdd8.),0,'end');&lt;/P&gt;&lt;P&gt;if input(put(int_date,yymmddn8.),8.) = filedd then filedd = input(put(int_date+1,yymmddn8.),8.);&lt;/P&gt;&lt;P&gt;drop int_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code snippet will find any date stored in your format that is the last of a month and replace it with the first of the following month. No need for dynamic code creation.&lt;/P&gt;&lt;P&gt;Of course, the whole operation would be &lt;SPAN style="text-decoration: underline;"&gt;much&lt;/SPAN&gt; easier if dates were stored as SAS date values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if filedd = intnx('month',filedd,0,'end') then filedd = filedd + 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 08:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212947#M39333</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-11T08:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212948#M39334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let YYYYMMDD="11MAY2015"d;&lt;/P&gt;&lt;P&gt;data need;&lt;/P&gt;&lt;P&gt;if &amp;amp;YYYYMMDD=intnx("month",today(),0,"e") then&amp;nbsp; &lt;/P&gt;&lt;P&gt;need=input(put(intnx("month",&amp;amp;YYYYMMDD,1,"b"),yymmddn8.),8.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 10:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212948#M39334</guid>
      <dc:creator>bharathtuppad</dc:creator>
      <dc:date>2015-05-11T10:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212949#M39335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code produces following values when I ran your code without any change. Is it correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="137"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="59"&gt;filedd&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="78"&gt;filedd_new&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;14-01-01&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;********&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;14-06-06&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;********&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 10:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212949#M39335</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2015-05-11T10:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212950#M39336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you running the exact code I provided and looking at the dataset as I see:&lt;/P&gt;&lt;P&gt;filedd&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filedd_new&lt;/P&gt;&lt;P&gt;14-01-01&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20131231&lt;/P&gt;&lt;P&gt;14-06-06&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20140531&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks to me like you are print the result somehow (**** means its too long for the print column).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 10:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212950#M39336</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-11T10:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212951#M39337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;babloo is right. The statement&lt;/P&gt;&lt;P&gt;format filedd_new yymmdd8.;&lt;/P&gt;&lt;P&gt;caused filedd_new to be defined numeric, which caused an improper conversion in the assignment. When the format is omitted, filedd_new is implicitly defined as character and holds the correct value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 11:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212951#M39337</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-11T11:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212952#M39338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah yes.&amp;nbsp; Should have looked like this:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format filedd yymmdd8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filedd="01JAN2014"d; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filedd="06JUN2014"d; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data daily_%sysfunc(today(),date9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format filedd_new date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; filedd_new=intnx('month',filedd,-1,"END"); &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 May 2015 12:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212952#M39338</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-11T12:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212953#M39339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your responses, please feel free to change the date format. I'm editiing it in the question itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 01:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212953#M39339</guid>
      <dc:creator>KP12</dc:creator>
      <dc:date>2015-05-12T01:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212954#M39340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;refdate = intnx('day',today(),-2);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call symput('YYYYMMDD',put(refdate,yymmddn8.));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call symput('refdate',put(refdate,best6.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data ORCL.BASE1&amp;amp;YYYYMMDD;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set MY_DIR.Daily_&amp;amp;YYYYMMDD.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if &amp;amp;refdate = intnx('month',&amp;amp;refdate,0,'end')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;then filedd = &amp;amp;refdate + 1;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 06:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212954#M39340</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-12T06:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212955#M39341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question can anybody explain what the below part is doing and its requirement&amp;nbsp; and why we have taken (-2 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;call symputx('tt1',put(intnx('day',today(),-2),yymmddn8.),G);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 13:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212955#M39341</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2015-05-14T13:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212956#M39342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have no idea why you wanted the date of the day before yesterday, you posted that bit of code &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;call symputx with G forces the creation of the macro variable in the global symbol table. To learn the difference between global and local symbol tables (and where variables are created per default), read the documentation of the SAS macro language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS intnx('day',today(),-2) is eqivalent to today()-2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 06:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212956#M39342</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-05-15T06:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Automate IF-ELSE statement inside a macro.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212957#M39343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kurt ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the explaination.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 09:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-IF-ELSE-statement-inside-a-macro/m-p/212957#M39343</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2015-05-15T09:02:11Z</dc:date>
    </item>
  </channel>
</rss>

