<?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: change value in last raw in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663801#M198231</link>
    <description>&lt;P&gt;Please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wanted(drop=UntilYYMM rename=(UntilYYMM_new=UntilYYMM));
retain month FromYYMM UntilYYMM;
set ttt;
UntilYYMM_new=ifn(UntilYYMM='31DEC2020'd,intnx('month',FromYYMM,1),UntilYYMM);
format UntilYYMM_new date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 21 Jun 2020 07:21:49 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2020-06-21T07:21:49Z</dc:date>
    <item>
      <title>change value in last raw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663796#M198230</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a new data set based on current data set ttt.&lt;/P&gt;
&lt;P&gt;I want to create a condition&amp;nbsp; that IF value of UntilYYMM is 31DEC2020 then&amp;nbsp; the value will be one month after FromYYMM value.&lt;/P&gt;
&lt;P&gt;However in wanted data set the value in last row was not changed as I wanted and it is still 31DEC2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ttt;
format  FromYYMM date9. UntilYYMM  date9.;
input month FromYYMM :date9. UntilYYMM :date9. ;
cards;
2003 15Feb2020 13MAR2020
2004 14MAR2020 11APR2020
2005 12APR2020 09MAY2020
2006 10MAY2020 31DEC2020
;
run;
data wanted(drop=UntilYYMM rename=(UntilYYMM_new=UntilYYMM));
retain month FromYYMM UntilYYMM;
set ttt;
if last.month then UntilYYMM_new=intnx('month',FromYYMM,1);
else UntilYYMM_new=UntilYYMM;
format UntilYYMM_new date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Jun 2020 06:01:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663796#M198230</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-06-21T06:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: change value in last raw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663801#M198231</link>
      <description>&lt;P&gt;Please try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wanted(drop=UntilYYMM rename=(UntilYYMM_new=UntilYYMM));
retain month FromYYMM UntilYYMM;
set ttt;
UntilYYMM_new=ifn(UntilYYMM='31DEC2020'd,intnx('month',FromYYMM,1),UntilYYMM);
format UntilYYMM_new date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Jun 2020 07:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663801#M198231</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2020-06-21T07:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: change value in last raw</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663804#M198232</link>
      <description>&lt;P&gt;Maxim 2: Read the Log.&lt;/P&gt;
&lt;P&gt;It will alert you about your incorrect use of last.month without a&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by month;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;statement.&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/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a new data set based on current data set ttt.&lt;/P&gt;
&lt;P&gt;I want to create a condition&amp;nbsp; that IF value of UntilYYMM is 31DEC2020 then&amp;nbsp; the value will be one month after FromYYMM value.&lt;/P&gt;
&lt;P&gt;However in wanted data set the value in last row was not changed as I wanted and it is still 31DEC2020&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ttt;
format  FromYYMM date9. UntilYYMM  date9.;
input month FromYYMM :date9. UntilYYMM :date9. ;
cards;
2003 15Feb2020 13MAR2020
2004 14MAR2020 11APR2020
2005 12APR2020 09MAY2020
2006 10MAY2020 31DEC2020
;
run;
data wanted(drop=UntilYYMM rename=(UntilYYMM_new=UntilYYMM));
retain month FromYYMM UntilYYMM;
set ttt;
if last.month then UntilYYMM_new=intnx('month',FromYYMM,1);
else UntilYYMM_new=UntilYYMM;
format UntilYYMM_new date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 07:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-value-in-last-raw/m-p/663804#M198232</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-21T07:34:13Z</dc:date>
    </item>
  </channel>
</rss>

