<?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 flagging the last record of a ID within a test when multiple records for an ID per test are seen. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/flagging-the-last-record-of-a-ID-within-a-test-when-multiple/m-p/860757#M340020</link>
    <description>&lt;PRE&gt;Data have;
input id $ test$ visit result;
1 ALT 1 25
1 ALT 2 35
1 ALT 3 35
2 ALT 1 20
3 AST 1 20
3 AST 2 20;
run;

Data want;
input id$ test$ visit result flg$;
1 ALT 1 25 .
1 ALT 2 35 .
1 ALT 3 35 Y
2 ALT 1 20 Y
3 AST 1 20 .
3 AST 2 20 Y;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 24 Feb 2023 20:02:31 GMT</pubDate>
    <dc:creator>sandhya88</dc:creator>
    <dc:date>2023-02-24T20:02:31Z</dc:date>
    <item>
      <title>flagging the last record of a ID within a test when multiple records for an ID per test are seen.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-the-last-record-of-a-ID-within-a-test-when-multiple/m-p/860757#M340020</link>
      <description>&lt;PRE&gt;Data have;
input id $ test$ visit result;
1 ALT 1 25
1 ALT 2 35
1 ALT 3 35
2 ALT 1 20
3 AST 1 20
3 AST 2 20;
run;

Data want;
input id$ test$ visit result flg$;
1 ALT 1 25 .
1 ALT 2 35 .
1 ALT 3 35 Y
2 ALT 1 20 Y
3 AST 1 20 .
3 AST 2 20 Y;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Feb 2023 20:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-the-last-record-of-a-ID-within-a-test-when-multiple/m-p/860757#M340020</guid>
      <dc:creator>sandhya88</dc:creator>
      <dc:date>2023-02-24T20:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: flagging the last record of a ID within a test when multiple records for an ID per test are seen</title>
      <link>https://communities.sas.com/t5/SAS-Programming/flagging-the-last-record-of-a-ID-within-a-test-when-multiple/m-p/860759#M340021</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    by id;
    if last.id then flg='Y'; else flg='.';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I may be so bold, setting FLG to 'Y' or '.' is not such a good idea; setting FLG to numeric 0 or 1 is not only easier to type, but has other benefits as well (such as computing proportions that are flagged can be done by computing a mean).&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 20:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/flagging-the-last-record-of-a-ID-within-a-test-when-multiple/m-p/860759#M340021</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-24T20:08:10Z</dc:date>
    </item>
  </channel>
</rss>

