<?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 Creating Macros Based on months in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43052#M11222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can we select the date insted of system date the report can be generated for any month the date should vary&lt;/P&gt;&lt;P&gt;march to march&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2012 13:45:04 GMT</pubDate>
    <dc:creator>santhosh</dc:creator>
    <dc:date>2012-03-27T13:45:04Z</dc:date>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43041#M11211</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;I am trying to create macros based on month&lt;/P&gt;&lt;P&gt;eg., if month is JAN FEB MAR then i need to&amp;nbsp; create year macro -1 year &lt;/P&gt;&lt;P&gt;else i want to create macro +1 year &lt;/P&gt;&lt;P&gt;if Month JAN/FEB/MAR 2012 then i want to create macro year 2011&lt;/P&gt;&lt;P&gt;else i want to create macro year 2012&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 06:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43041#M11211</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2012-03-26T06:14:40Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43042#M11212</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;i the macro value (+1 year)&amp;nbsp; (-1year) like that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 06:21:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43042#M11212</guid>
      <dc:creator>manojinpec</dc:creator>
      <dc:date>2012-03-26T06:21:37Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43043#M11213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating macro year based on months conditionally&lt;/P&gt;&lt;P&gt;if month is JAN/FEB/MAR 2012 then want to create macro year=2011&lt;/P&gt;&lt;P&gt;else macro year=2012&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 07:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43043#M11213</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2012-03-26T07:00:50Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43044#M11214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;%let day='02jul2012'd ;

options minoperator;
%macro&amp;nbsp; a;
%if %sysfunc(substr(%sysfunc(putn(&amp;amp;day,monyy.)),1,3)) in JAN FEB MAR %then 
 %do;data _null_;call symputx('year',year(&amp;amp;day)-1);stop;run;%end;
 %else %do;data _null_;call symputx('year',year(&amp;amp;day));stop;run;%end;
%mend a;
%a
%put &amp;amp;year ;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 10:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43044#M11214</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-26T10:10:21Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43045#M11215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if the 'date'&amp;nbsp; goes with your system time dynamically,&amp;nbsp; you don't need to feed it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;if month(date()) in (1,2,3) then&lt;/P&gt;&lt;P&gt;call symputx('year',year(date())-1);&lt;/P&gt;&lt;P&gt;else call symputx('year',year(date()));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put &amp;amp;year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 11:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43045#M11215</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-26T11:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43046#M11216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shifted interval...&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;29&amp;nbsp;&amp;nbsp; %let day='02jul2012'd ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;30&amp;nbsp;&amp;nbsp; %let year=%sysfunc(intnx(Year1.4,&amp;amp;day,0),year.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;31&amp;nbsp;&amp;nbsp; %put YEAR=&amp;amp;YEAR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;YEAR=2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;35&amp;nbsp;&amp;nbsp; %let day='02feb2012'd ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;36&amp;nbsp;&amp;nbsp; %let year=%sysfunc(intnx(Year1.4,&amp;amp;day,0),year.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;37&amp;nbsp;&amp;nbsp; %put YEAR=&amp;amp;YEAR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;YEAR=2011&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 12:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43046#M11216</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-26T12:45:38Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43047#M11217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is working fine &lt;/P&gt;&lt;P&gt;title of program is report generated for the period 31 Dec 2011 for financial year 2011-2012 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; (if month is from april 2011 to march 2012)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if month is April 2012 then title will be " for financial year 2012-2013"&lt;/P&gt;&lt;P&gt;i am unable to put other date &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 13:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43047#M11217</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2012-03-26T13:47:24Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43048#M11218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data _null_'s code will for you then.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 14:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43048#M11218</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-26T14:05:22Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43049#M11219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for&amp;nbsp; your support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to generate a title &lt;/P&gt;&lt;P&gt;if the report generating period is form April 2011 to Mar2012 then title=&lt;/P&gt;&lt;P&gt;"for the financial year 2011 to 2012" &lt;/P&gt;&lt;P&gt;if the report is generating for period dec 2011 then title will be "for the financial year 2011-2012"&lt;/P&gt;&lt;P&gt;if the report is generating for period jan 2012 then title will be " for the financial year 2011-2012"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 14:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43049#M11219</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2012-03-26T14:12:40Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43050#M11220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I maybe misunderstand your question, but could it be done by just&amp;nbsp; using the title statement?&lt;/P&gt;&lt;P&gt;Supposely you have already run _null_'s code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Title "for the financial year &amp;amp;year.- %eval(&amp;amp;year.+1)";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 14:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43050#M11220</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-03-26T14:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43051#M11221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;38&amp;nbsp;&amp;nbsp; %let day='02feb2012'd ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;39&amp;nbsp;&amp;nbsp; %let year=%sysfunc(intnx(Year1.4,&amp;amp;day,0,B),year.)-%sysfunc(intnx(Year1.4,&amp;amp;day,0,E),year.);;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;40&amp;nbsp;&amp;nbsp; %put YEAR=&amp;amp;YEAR;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;YEAR=2011-2012&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 15:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43051#M11221</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-03-26T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Creating Macros Based on months</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43052#M11222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks for support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can we select the date insted of system date the report can be generated for any month the date should vary&lt;/P&gt;&lt;P&gt;march to march&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2012 13:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-Macros-Based-on-months/m-p/43052#M11222</guid>
      <dc:creator>santhosh</dc:creator>
      <dc:date>2012-03-27T13:45:04Z</dc:date>
    </item>
  </channel>
</rss>

