<?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: condition, year ago in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562994#M10815</link>
    <description>&lt;P&gt;Unfortunately your question is still unclear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show:&lt;/P&gt;
&lt;P&gt;An example of what you have (variable, data set, code)&lt;/P&gt;
&lt;P&gt;What you want as the output?&lt;/P&gt;
&lt;P&gt;What isn't working - for example include the log or output that shows what you get.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269250"&gt;@yesidgranadosv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Exactly you are right... The idea is that it is a simpler code and the program would run daily and would not apply for what I want... I just wanted to express the result I want to get...&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not how to express it in a new code much more efficient for what I want&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 May 2019 19:51:48 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-05-31T19:51:48Z</dc:date>
    <item>
      <title>condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562968#M10811</link>
      <description>&lt;DIV class="mt-info-text"&gt;I have this code which gives me back the date of 201601&lt;/DIV&gt;&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mt-info-text"&gt;&lt;P&gt;/*Año y mes Atras*/&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_FIN', put(intnx ('month',today(),-40),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%put Fetch_FIN = &amp;amp;Fetch_FIN.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mt-info-text"&gt;Could help me improve the code and other than this I need a condition with the every time it is a new year is added a year more to the result&lt;/DIV&gt;&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mt-info-text"&gt;&lt;DIV class="mt-info-text"&gt;I mean that when it is 2020 the result of Fetch_FIN is 2017&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 May 2019 19:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562968#M10811</guid>
      <dc:creator>yesidgranadosv</dc:creator>
      <dc:date>2019-05-31T19:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562969#M10812</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269250"&gt;@yesidgranadosv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="mt-info-text"&gt;I have this code which gives me back the date of 201601&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;
&lt;P&gt;/*Año y mes Atras*/&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_FIN', put(intnx ('month',today(),-40),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%put Fetch_FIN = &amp;amp;Fetch_FIN.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mt-info-text"&gt;Could help me improve the code&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Improve in what way??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="mt-info-text"&gt;and other than this I need a condition with the every time it is a new year is added a year more to the result&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="mt-info-text"&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="mt-info-text"&gt;I mean that when it is 2020 the result of Fetch_FIN is 2017&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;If I run this today (May 31, 2019), I get 201601. If I run it a year from now (May 31, 2020), I should get 201701 and in fact the code will provide the answer 201701 when run one year from today.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;So I don't understand the question.&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 31 May 2019 19:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562969#M10812</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-31T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562970#M10813</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Exactly you are right... The idea is that it is a simpler code and the program would run daily and would not apply for what I want... I just wanted to express the result I want to get...&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not how to express it in a new code much more efficient for what I want&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 19:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562970#M10813</guid>
      <dc:creator>yesidgranadosv</dc:creator>
      <dc:date>2019-05-31T19:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562973#M10814</link>
      <description>&lt;P&gt;Honestly, I don't understand the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use the word "Simpler" but the code is 4 lines, it's hard to get simpler than that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use the word "efficient" but the code runs in fractions of a second, it's hard to get more efficient than that.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 19:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562973#M10814</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-31T19:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562994#M10815</link>
      <description>&lt;P&gt;Unfortunately your question is still unclear.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show:&lt;/P&gt;
&lt;P&gt;An example of what you have (variable, data set, code)&lt;/P&gt;
&lt;P&gt;What you want as the output?&lt;/P&gt;
&lt;P&gt;What isn't working - for example include the log or output that shows what you get.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269250"&gt;@yesidgranadosv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Exactly you are right... The idea is that it is a simpler code and the program would run daily and would not apply for what I want... I just wanted to express the result I want to get...&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not how to express it in a new code much more efficient for what I want&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 19:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/562994#M10815</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-31T19:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/563008#M10822</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/269250"&gt;@yesidgranadosv&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="mt-info-text"&gt;I have this code which gives me back the date of 201601&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;
&lt;P&gt;/*Año y mes Atras*/&lt;BR /&gt;data _null_;&lt;BR /&gt;call symputx('Fetch_FIN', put(intnx ('month',today(),-40),yymmn6.) );&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%put Fetch_FIN = &amp;amp;Fetch_FIN.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mt-info-text"&gt;Could help me improve the code and other than this I need a condition with the every time it is a new year is added a year more to the result&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mt-info-text"&gt;
&lt;DIV class="mt-info-text"&gt;I mean that when it is 2020 the result of Fetch_FIN is 2017&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you are concerned about a specific interval of years then do not rely on 'month'. If you want to get the first day of the year then use an alignment value of 'B'. Example to get the beginning of the year that is 3 years prior. Note this will return the same value for ANY date in 2020. If that is not the desired output then you need to provide better examples of your input value(s) and the expected output.&lt;/P&gt;
&lt;PRE&gt;data _null_;
call symputx('Fetch_FIN', put(intnx ('year','01MAR2020'd,-3,'B'),yymmn6.) );
run;

%put Fetch_FIN = &amp;amp;Fetch_FIN.;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 May 2019 20:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/563008#M10822</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-31T20:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: condition, year ago</title>
      <link>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/563042#M10831</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    %let Fetch_FIN =%sysfunc(intnx(month,%sysfunc(today()),-40),yymmn6);
2    %put NOTE: &amp;amp;Fetch_fin;
NOTE: 201601
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 May 2019 22:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/condition-year-ago/m-p/563042#M10831</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-05-31T22:58:52Z</dc:date>
    </item>
  </channel>
</rss>

