<?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: One Value to Rule them all! Trouble using last value as value for all in group in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863546#M341097</link>
    <description>&lt;P&gt;This is really all you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Have;&lt;BR /&gt;input ID Name $;&lt;BR /&gt;cards;&lt;BR /&gt;1 .&lt;BR /&gt;1 Yes&lt;BR /&gt;2 .&lt;BR /&gt;2 No&lt;BR /&gt;3 .&lt;BR /&gt;3 Yes&lt;BR /&gt;4 No&lt;BR /&gt;5 .&lt;BR /&gt;5 .&lt;BR /&gt;5 Yes&lt;BR /&gt;6 No&lt;BR /&gt;8 Yes&lt;BR /&gt;;&lt;BR /&gt;data new;&lt;BR /&gt;set have;&lt;BR /&gt;by id;&lt;BR /&gt;if last.id then output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data final;&lt;BR /&gt;merge have(in=a) new(rename=(name=name2));&lt;BR /&gt;by id;&lt;BR /&gt;if a;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 21:02:11 GMT</pubDate>
    <dc:creator>russt_sas</dc:creator>
    <dc:date>2023-03-10T21:02:11Z</dc:date>
    <item>
      <title>One Value to Rule them all! Trouble using last value as value for all in group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863535#M341094</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was having trouble using the last value in my groups as the value for all members in my groups. Basically, I want whatever the last value in the group is to be the value for all members in that group.&lt;/P&gt;&lt;P&gt;What I have:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data Have;
input ID Name $;
cards;
1 ''
1 Yes
2 '' 
2 No 
3 ''
3 '' 
3 Yes
4 No
5 '' 
5 Yes 
6 No 
8 Yes 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Which looks like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMagenta_0-1678479521006.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81352iC040F68C3E8B28CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JMagenta_0-1678479521006.png" alt="JMagenta_0-1678479521006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But What I WANT:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMagenta_1-1678479569603.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81353i8F446E1381AE3E02/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JMagenta_1-1678479569603.png" alt="JMagenta_1-1678479569603.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How can I achieve my goal? Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 20:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863535#M341094</guid>
      <dc:creator>JMagenta</dc:creator>
      <dc:date>2023-03-10T20:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: One Value to Rule them all! Trouble using last value as value for all in group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863542#M341096</link>
      <description>&lt;P&gt;Here is one way to accomplish your task:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Have; &lt;BR /&gt;input ID Name $; &lt;BR /&gt;cards; &lt;BR /&gt;1 . &lt;BR /&gt;1 Yes &lt;BR /&gt;2 . &lt;BR /&gt;2 No &lt;BR /&gt;3 . &lt;BR /&gt;3 Yes &lt;BR /&gt;4 No &lt;BR /&gt;5 . &lt;BR /&gt;5 . &lt;BR /&gt;5 Yes &lt;BR /&gt;6 No &lt;BR /&gt;8 Yes &lt;BR /&gt;; &lt;BR /&gt;data new; &lt;BR /&gt;set have; &lt;BR /&gt;by id; &lt;BR /&gt;if last.id then output; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data final; &lt;BR /&gt;merge have(in=a) new(rename=(name=name2)); &lt;BR /&gt;by id; &lt;BR /&gt;if a; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data final2; &lt;BR /&gt;set final; &lt;BR /&gt;retain name2; &lt;BR /&gt;by id; &lt;BR /&gt;if first.id then new=name2; &lt;BR /&gt;if name ne . then new=name; &lt;BR /&gt;keep id name2; &lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;proc print; &lt;BR /&gt;run; &lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 20:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863542#M341096</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2023-03-10T20:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: One Value to Rule them all! Trouble using last value as value for all in group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863546#M341097</link>
      <description>&lt;P&gt;This is really all you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data Have;&lt;BR /&gt;input ID Name $;&lt;BR /&gt;cards;&lt;BR /&gt;1 .&lt;BR /&gt;1 Yes&lt;BR /&gt;2 .&lt;BR /&gt;2 No&lt;BR /&gt;3 .&lt;BR /&gt;3 Yes&lt;BR /&gt;4 No&lt;BR /&gt;5 .&lt;BR /&gt;5 .&lt;BR /&gt;5 Yes&lt;BR /&gt;6 No&lt;BR /&gt;8 Yes&lt;BR /&gt;;&lt;BR /&gt;data new;&lt;BR /&gt;set have;&lt;BR /&gt;by id;&lt;BR /&gt;if last.id then output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data final;&lt;BR /&gt;merge have(in=a) new(rename=(name=name2));&lt;BR /&gt;by id;&lt;BR /&gt;if a;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 21:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863546#M341097</guid>
      <dc:creator>russt_sas</dc:creator>
      <dc:date>2023-03-10T21:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: One Value to Rule them all! Trouble using last value as value for all in group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863552#M341098</link>
      <description>&lt;P&gt;DOW loop:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
do until (last.id);
  set have (rename=(name=_n));
  by id;
end;
do until (last.id);
  set have;
  by id;
  name = _n;
  output;
end;
drop _n;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Mar 2023 21:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863552#M341098</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-10T21:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: One Value to Rule them all! Trouble using last value as value for all in group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863554#M341099</link>
      <description>&lt;P&gt;This kind of worked, only I am now missing some data somehow. I also have duplicates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;J&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 21:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863554#M341099</guid>
      <dc:creator>JMagenta</dc:creator>
      <dc:date>2023-03-10T21:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: One Value to Rule them all! Trouble using last value as value for all in group</title>
      <link>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863555#M341100</link>
      <description>&lt;P&gt;Thank you much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;J&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 21:56:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/One-Value-to-Rule-them-all-Trouble-using-last-value-as-value-for/m-p/863555#M341100</guid>
      <dc:creator>JMagenta</dc:creator>
      <dc:date>2023-03-10T21:56:26Z</dc:date>
    </item>
  </channel>
</rss>

