<?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: Fill a variable matching by lines in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637297#M21447</link>
    <description>&lt;P&gt;Since we don't have a data set to work with, this is untested code.&amp;nbsp; You'll need to test it to see how close it comes to answering your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
   by age ID;
run;

data want;
   set have;
   if _n_=1 then id_age_min = id;
   retain id_age_min;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Apr 2020 15:57:46 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2020-04-03T15:57:46Z</dc:date>
    <item>
      <title>Fill a variable matching by lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637260#M21441</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I want to change this code that will fill a variable with the ID corresponding to a minimum age. Because in case we have more than one ID with the same minimum age, I would like to bring the minimum ID (containing the minimum age) for the variable ID_AGE_MIN.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;proc sql;
   create table want as
   select *, (select id from have having min(age)=age) as id_min_age
   from have;
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Apr 2020 13:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637260#M21441</guid>
      <dc:creator>usuario_estudo</dc:creator>
      <dc:date>2020-04-03T13:18:04Z</dc:date>
    </item>
    <item>
      <title>Fill a variable matching by lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637255#M21443</link>
      <description>&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;I want to change this code that will fill a variable with the ID corresponding to a minimum age. Because in case we have more than one ID with the same minimum age, I would like to bring the minimum ID (containing the minimum age) for the variable ID_AGE_MIN.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;proc sql;
   create table want as
   select *, (select id from have having min(age)=age) as id_min_age
   from have;
quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 13:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637255#M21443</guid>
      <dc:creator>usuario_estudo</dc:creator>
      <dc:date>2020-04-03T13:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Fill a variable matching by lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637267#M21444</link>
      <description>&lt;P&gt;Please post data in self-contained data steps with datalines, as you were shown in&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/Create-a-code-in-SAS-with-correspondences-by-line-like-a-vlookup/m-p/637046/highlight/true#M21418" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/New-SAS-User/Create-a-code-in-SAS-with-correspondences-by-line-like-a-vlookup/m-p/637046/highlight/true#M21418&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Filter-the-last-rows/m-p/504821/highlight/true#M32249" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Filter-the-last-rows/m-p/504821/highlight/true#M32249&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/SAS-Filter/m-p/505067/highlight/true#M1089" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/New-SAS-User/SAS-Filter/m-p/505067/highlight/true#M1089&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And please do not double-post.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 13:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637267#M21444</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-03T13:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Fill a variable matching by lines</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637297#M21447</link>
      <description>&lt;P&gt;Since we don't have a data set to work with, this is untested code.&amp;nbsp; You'll need to test it to see how close it comes to answering your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
   by age ID;
run;

data want;
   set have;
   if _n_=1 then id_age_min = id;
   retain id_age_min;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Apr 2020 15:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Fill-a-variable-matching-by-lines/m-p/637297#M21447</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-04-03T15:57:46Z</dc:date>
    </item>
  </channel>
</rss>

