<?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: Assigning Repeating Values Based on Repeating IDs in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893835#M39768</link>
    <description>&lt;P&gt;Suppose you had the chosen values in a dataset have2 (completely made up based on the values you're displaying):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ID  Selected
101 656
501 999
502 999&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then a PROC SQL left join will do the trick:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    select t1.id, t1.value, t2.selected
    from have as t1 left join have2 as t2
    on t1.id = t2.id;
quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 15:58:03 GMT</pubDate>
    <dc:creator>antonbcristina</dc:creator>
    <dc:date>2023-09-12T15:58:03Z</dc:date>
    <item>
      <title>Assigning Repeating Values Based on Repeating IDs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893828#M39766</link>
      <description>&lt;P&gt;I have a dataset where I need to make sure that each like ID gets assigned the same Value. It's not so much that I need to select a specific value to repeat from all that are assigned to the like ID, but that I need all the like IDs to have the same Value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Have:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; Id   Value
101   656
101   756
101   805
101   752      
501   999
502   405
502&amp;nbsp;&amp;nbsp;&amp;nbsp;365&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Data Want:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; Id   Value   Selected
101   656     656
101   756     656
101   805     656
101   752     656   
501   999     999
502   405     999
502&amp;nbsp;&amp;nbsp;&amp;nbsp;365&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;999&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 15:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893828#M39766</guid>
      <dc:creator>chsprogramming</dc:creator>
      <dc:date>2023-09-12T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Repeating Values Based on Repeating IDs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893830#M39767</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    by id;
    retain selected;
    if first.id then selected=value;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Sep 2023 15:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893830#M39767</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-09-12T15:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Repeating Values Based on Repeating IDs</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893835#M39768</link>
      <description>&lt;P&gt;Suppose you had the chosen values in a dataset have2 (completely made up based on the values you're displaying):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ID  Selected
101 656
501 999
502 999&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then a PROC SQL left join will do the trick:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    select t1.id, t1.value, t2.selected
    from have as t1 left join have2 as t2
    on t1.id = t2.id;
quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 15:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Assigning-Repeating-Values-Based-on-Repeating-IDs/m-p/893835#M39768</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2023-09-12T15:58:03Z</dc:date>
    </item>
  </channel>
</rss>

