<?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: Date parameters for exactly a year ago in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629250#M186050</link>
    <description>&lt;P&gt;You need a different call to INTNX(). For example, 11 months earlier would use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;intnx('month',today(),-11)&lt;/P&gt;</description>
    <pubDate>Tue, 03 Mar 2020 20:18:45 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-03-03T20:18:45Z</dc:date>
    <item>
      <title>Date parameters for exactly a year ago</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629247#M186048</link>
      <description>&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 color="#0000ff" face="Courier New" size="3"&gt;_NULL_&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;CALL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SYMPUTx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'mth1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'year'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,today(),-&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;'b'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;monyy5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'g'&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;CALL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SYMPUTx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'mth12'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'year'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,today(),-&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;'e'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;monyy5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'g'&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;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Output is &lt;/FONT&gt;JAN19 and Dec19 respectively&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am attempting to get remaining months exactly 1 full year ago starting with Jan19&lt;/P&gt;
&lt;P&gt;How would I be able to use the same logic for say FEB19, MAR19...etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 20:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629247#M186048</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2020-03-03T20:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Date parameters for exactly a year ago</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629250#M186050</link>
      <description>&lt;P&gt;You need a different call to INTNX(). For example, 11 months earlier would use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;intnx('month',today(),-11)&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 20:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629250#M186050</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-03T20:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date parameters for exactly a year ago</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629267#M186057</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&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 color="#0000ff" face="Courier New" size="3"&gt;_NULL_&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;CALL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SYMPUTx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'mth1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'year'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,today(),-&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;'b'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;monyy5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'g'&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;CALL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; SYMPUTx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'mth12'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'year'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,today(),-&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;'e'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;monyy5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'g'&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;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Output is &lt;/FONT&gt;JAN19 and Dec19 respectively&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am attempting to get remaining months exactly 1 full year ago starting with Jan19&lt;/P&gt;
&lt;P&gt;How would I be able to use the same logic for say FEB19, MAR19...etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have to say I do not understand what you mean by "remaining months". or what the actual desired output for a given input is here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Normally "remaining months" to me would be a number of months left after removing or some interval. So for "exactly 1 full year" that would tend to be 12 months?!?&lt;/P&gt;
&lt;P&gt;If you expect to create date incrementing months then I would expect to see an interval unit of 'month'.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 20:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629267#M186057</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-03T20:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date parameters for exactly a year ago</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629268#M186058</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _NULL_;
  do i = 0 to 11;
    CALL SYMPUTx(cats('mth',i+1),put(intnx('month',today(),-12+i,'b'),monyy5.),'g');
  end;
run;
%put _user_;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best&lt;/P&gt;&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 20:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-parameters-for-exactly-a-year-ago/m-p/629268#M186058</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-03-03T20:39:09Z</dc:date>
    </item>
  </channel>
</rss>

