<?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: Variable Selection in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918615#M361839</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by studyID;
where firstResult ne 'See Text';
if first.studyID;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use FIRST assuming it's sorted and a WHERE to remove the SEE TEXT records.&amp;nbsp;&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/429694"&gt;@Gregorytus07&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have a dataset that contains multiple result rows for each study ID. I need help in writing a SAS code that selects the first result for each study ID. If the first result is 'See Text', then select the next result value for that study ID.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2024 16:33:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2024-03-01T16:33:03Z</dc:date>
    <item>
      <title>Variable Selection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918607#M361835</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a dataset that contains multiple result rows for each study ID. I need help in writing a SAS code that selects the first result for each study ID. If the first result is 'See Text', then select the next result value for that study ID.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 15:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918607#M361835</guid>
      <dc:creator>Gregorytus07</dc:creator>
      <dc:date>2024-03-01T15:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Selection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918612#M361838</link>
      <description>&lt;P&gt;Please clarify: your title says "Variable Selection" but your description implies you want to select rows. Which is it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In either case, please provide sample data, and show us the desired output.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918612#M361838</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-01T16:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Selection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918615#M361839</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
by studyID;
where firstResult ne 'See Text';
if first.studyID;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use FIRST assuming it's sorted and a WHERE to remove the SEE TEXT records.&amp;nbsp;&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/429694"&gt;@Gregorytus07&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have a dataset that contains multiple result rows for each study ID. I need help in writing a SAS code that selects the first result for each study ID. If the first result is 'See Text', then select the next result value for that study ID.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918615#M361839</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-03-01T16:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Selection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918622#M361843</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp; Thanks for your feedback.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a sample data&lt;/P&gt;&lt;P&gt;DATA YOUR_DATASET;&lt;BR /&gt;INPUT STUDYID GLUCOSE$;&lt;BR /&gt;DATALINES;&lt;BR /&gt;1 100&lt;BR /&gt;1 120&lt;BR /&gt;1 See Text&lt;BR /&gt;2 85&lt;BR /&gt;2 95&lt;BR /&gt;3 See Text&lt;BR /&gt;3 110&lt;BR /&gt;4 See Text&lt;BR /&gt;4 80&lt;BR /&gt;4 90&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The desired output should be similar to this;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Study_id&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Glucose&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;100&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;85&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;110&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;80&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918622#M361843</guid>
      <dc:creator>Gregorytus07</dc:creator>
      <dc:date>2024-03-01T16:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Selection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918623#M361844</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;Thanks for sharing this. I will try it out.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918623#M361844</guid>
      <dc:creator>Gregorytus07</dc:creator>
      <dc:date>2024-03-01T16:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Selection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918631#M361850</link>
      <description>&lt;P&gt;Is it possible that a StudyID has all its observations saying "No Text"?&amp;nbsp; If so, the proposed solution will exclude that StudyID entirely.&amp;nbsp; To guarantee selecting an observation for each StudyID, a slight variation would do the trick:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have (where=(firstResult ne 'See Text'))
    have (where=(firstResult eq 'See Text'));
by studyID;
if first.studyID;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Mar 2024 18:18:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-Selection/m-p/918631#M361850</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2024-03-01T18:18:44Z</dc:date>
    </item>
  </channel>
</rss>

