<?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: SAS Date Quarer formating based on current date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772574#M245321</link>
    <description>&lt;P&gt;Hello Reeza,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 21:00:25 GMT</pubDate>
    <dc:creator>Mushy</dc:creator>
    <dc:date>2021-10-06T21:00:25Z</dc:date>
    <item>
      <title>SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772528#M245298</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation where I need to report on quarterly basis.&lt;/P&gt;&lt;P&gt;I need to manipulate the quarters considering the current date.&lt;/P&gt;&lt;P&gt;So if today is 06OCT, I need a Quarter format that represents 3 months, from now to minus 3 three months... say the latest quarter should have values for the date 06 JUL to 06 OCT. So the format should dynamically determine the 3 months cut off. Is there a predefined method for this in SAS or anyone could help in how this could be achieved?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mushy&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772528#M245298</guid>
      <dc:creator>Mushy</dc:creator>
      <dc:date>2021-10-06T18:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772529#M245299</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Intnx('month',date,-3,'s')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will do this calculation.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772529#M245299</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-06T18:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772531#M245301</link>
      <description>&lt;P&gt;Hello Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for responding.&lt;/P&gt;&lt;P&gt;But I need the format applied to all the historical data as well.&lt;/P&gt;&lt;P&gt;say we have date for 2 years. I need to fit a format defines for each 3 previous months from today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mushy&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 18:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772531#M245301</guid>
      <dc:creator>Mushy</dc:creator>
      <dc:date>2021-10-06T18:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772543#M245306</link>
      <description>I would build a dynamic format using a loop. So figure out the period you're reporting for, ie - how far back does the dates need to go, and build a custom format each month using CNTLIN. &lt;BR /&gt;&lt;BR /&gt;Do you know how to loop and use INTNX()?</description>
      <pubDate>Wed, 06 Oct 2021 19:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772543#M245306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-06T19:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772547#M245309</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;Considering the oldest date = 06oct2019, could you help with the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 19:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772547#M245309</guid>
      <dc:creator>Mushy</dc:creator>
      <dc:date>2021-10-06T19:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772556#M245312</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data date_format;
start_date=today();

fmtname = 'custom_qtr_fmt';
type = 'N';

n_intervals = intck('quarters',  '06Oct2019'd, start_date);

do i=1 to n_intervals;
end = intnx('quarter', start_date, -1*(i-1), 's');
start = intnx('quarter', start_date, -1*(i), 's');
label = catx(" - ", put(start, date9.), put(end, date9.));
output;
end;

format start: end: date9.;

run;

proc format cntlin = date_format;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then apply as needed within the proc.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 20:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772556#M245312</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-06T20:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Quarer formating based on current date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772574#M245321</link>
      <description>&lt;P&gt;Hello Reeza,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 21:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Quarer-formating-based-on-current-date/m-p/772574#M245321</guid>
      <dc:creator>Mushy</dc:creator>
      <dc:date>2021-10-06T21:00:25Z</dc:date>
    </item>
  </channel>
</rss>

