<?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: Subject selection based on if conditional processing. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208424#M38743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That will output matched group with &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;'EOS' OR 'LOGS' .&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2015 14:04:22 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2015-07-23T14:04:22Z</dc:date>
    <item>
      <title>Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208414#M38733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAS Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a data set having multiple subj Id , where few subjects have multiple visits and few have only a single visit. Let say, the Day 0 is baseline visit and following visits are post baseline .&lt;/P&gt;&lt;P&gt;i need to select only subjects who have at least one post baseline visit and to eliminate subjects who have no post baseline . But here i have one subject who have post baseline visits but no data is recorded for those post baseline . i also need to eliminate these subjects who have post baseline visit but where no data is recorded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if any subject having at least one non missing post baseline data , we have to select its all observation regardless weather it is missing or not.&lt;/P&gt;&lt;P&gt;i have attached the data ( sample) for your reference. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_USUBJID _VISNAME _PAGNAME VSBPSYS&lt;/P&gt;&lt;P&gt;01/001 DAY0 PAGE007&amp;nbsp;&amp;nbsp; 130&lt;/P&gt;&lt;P&gt;01/001 WEEK01 PAGE010&lt;/P&gt;&lt;P&gt;01/001 WEEK02 PAGE013&lt;/P&gt;&lt;P&gt;01/001 WEEK04 PAGE016&lt;/P&gt;&lt;P&gt;01/001 WEEK08 PAGE018&lt;/P&gt;&lt;P&gt;01/001 WEEK12 PAGE020&lt;/P&gt;&lt;P&gt;01/004 DAY0 PAGE007&amp;nbsp;&amp;nbsp; 130&lt;/P&gt;&lt;P&gt;01/004 WEEK01 PAGE010&amp;nbsp;&amp;nbsp; 130&lt;/P&gt;&lt;P&gt;01/004 WEEK02 PAGE013&amp;nbsp;&amp;nbsp; 149&lt;/P&gt;&lt;P&gt;01/004 WEEK04 PAGE016&amp;nbsp;&amp;nbsp; 144&lt;/P&gt;&lt;P&gt;02/003&amp;nbsp; DAY0 PAGE007&amp;nbsp;&amp;nbsp; 122&lt;/P&gt;&lt;P&gt;03/010 DAY0 PAGE007&amp;nbsp;&amp;nbsp; 129&lt;/P&gt;&lt;P&gt;03/010 WEEK01 PAGE010&lt;/P&gt;&lt;P&gt;03/010 WEEK02 PAGE013&amp;nbsp;&amp;nbsp; 135&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so as per above , i need subjid 01/004 and 03/010.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 05:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208414#M38733</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2015-07-22T05:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208415#M38734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using following code. its selecting few but not all as desired.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data vs_Rand1(keep=_usubjid _visname vsbpsys x _pagname);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set vs_Rand;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by _usubjid;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (first._usubjid and last._usubjid) or (not(first._usubjid or last._usubjid) and lag(vsbpsys) eq .) &lt;/P&gt;&lt;P&gt;&amp;nbsp; then x=1;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 05:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208415#M38734</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2015-07-22T05:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208416#M38735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use exists() in SQL:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HAVE A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where exists(select distinct USUBJID from HAVE where USUBJID=A.USUBJID and VISIT=0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and exists(select distinct USUBJID from HAVE where USUBJID=A.USUBJID and VISIT &amp;gt; 0 and SOMEDATA is not null);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 08:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208416#M38735</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-22T08:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208417#M38736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understood what you mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 style="color: #353535; font-family: Lato, sans-serif; background-color: #f0f1f2;"&gt;Code: Program&lt;/H3&gt;&lt;PRE class="sce-render" style="font-family: 'Courier New', Menlo, 'Lucida Console'; font-size: 16px;"&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;infile&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;input&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_USUBJID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_VISNAME&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_PAGNAME&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;VSBPSYS&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;cards&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/001 DAY0 PAGE007 130&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/001 WEEK01 PAGE010&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/001 WEEK02 PAGE013&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/001 WEEK04 PAGE016&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/001 WEEK08 PAGE018&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/001 WEEK12 PAGE020&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/004 DAY0 PAGE007 130&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/004 WEEK01 PAGE010 130&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/004 WEEK02 PAGE013 149&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;01/004 WEEK04 PAGE016 144&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;02/003 DAY0 PAGE007 122&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;03/010 DAY0 PAGE007 129&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;03/010 WEEK01 PAGE010&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="cards-data" style="color: #bb9905;"&gt;03/010 WEEK02 PAGE013 135&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;want&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;do&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;until&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;last.&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_USUBJID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;set&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;by&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_USUBJID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_VISNAME&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="string" style="color: #800080;"&gt;'WEEK'&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;do&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;has_week&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;not&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;missing&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;VSBPSYS&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;has_value&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;end&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;end&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;do&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;until&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="format" style="color: #008080;"&gt;last.&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_USUBJID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;set&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;have&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;by&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;_USUBJID&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;has_week&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;and&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;has_value&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="numeric" style="color: #008080; font-weight: bold;"&gt;1&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;then&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;output&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;end&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="keyword" style="color: #0000ff;"&gt;drop&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;has_week&lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt; &lt;/SPAN&gt;&lt;SPAN class="text" style="color: black;"&gt;has_value&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="sec-keyword" style="color: #000080; font-weight: bold;"&gt;run&lt;/SPAN&gt;&lt;SPAN class="sep" style="color: black;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 12:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208417#M38736</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-07-22T12:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208418#M38737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are certain your baseline is always there and have a VSBPSYS, you can simply count it. Otherwise, it needs small tweak. (Raw input is credited to &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; (_USUBJID _VISNAME _PAGNAME VSBPSYS) ($);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/001 DAY0 PAGE007 130&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/001 WEEK01 PAGE010&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/001 WEEK02 PAGE013&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/001 WEEK04 PAGE016&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/001 WEEK08 PAGE018&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/001 WEEK12 PAGE020&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/004 DAY0 PAGE007 130&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/004 WEEK01 PAGE010 130&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/004 WEEK02 PAGE013 149&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;01/004 WEEK04 PAGE016 144&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;02/003 DAY0 PAGE007 122&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;03/010 DAY0 PAGE007 129&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;03/010 WEEK01 PAGE010&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;03/010 WEEK02 PAGE013 135&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; have&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _USUBJID&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;having&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; count(VSBPSYS) &amp;gt; &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 15:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208418#M38737</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-07-22T15:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208419#M38738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No , some times baseline visit is there but doesn't have the vsbpsys value . no all such cases where we have missing baseline value of vsbpsys , should not be included and must be eliminated from the dataset.( along with its subsequent missing post baseline values).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 04:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208419#M38738</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2015-07-23T04:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208420#M38739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; . it's working the way i wanted. can u please explain the coding logic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 09:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208420#M38739</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2015-07-23T09:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208421#M38740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry. I have no time to do that. &lt;/P&gt;&lt;P&gt;It is DOW skill. You can search it at this forum or at support.sas.com &lt;/P&gt;&lt;P&gt;You would get tons of paper or post to talk about it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 11:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208421#M38740</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-07-23T11:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208422#M38741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;xia keshan : Thanks for your valuable time. well in addition i would like to ask what if visit values are not 'WEEK' or just to say lets add few more visits say 'EOS' OR 'LOGS' in above data. How to select obs in that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 13:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208422#M38741</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2015-07-23T13:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208423#M38742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then a small tweak would do,&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; have&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _USUBJID&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;having&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; sum(_VISNAME=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'DAY0'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;AND&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;NOT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; MISSING(VSBPSYS))=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; count(VSBPSYS) &amp;gt; &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 13:53:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208423#M38742</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-07-23T13:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208424#M38743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That will output matched group with &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;'EOS' OR 'LOGS' .&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 14:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208424#M38743</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-07-23T14:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208425#M38744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;since you ask for it here is a simpler code:&lt;/P&gt;&lt;P&gt;data have2 have3;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;by _usubjid;&lt;/P&gt;&lt;P&gt;where nmiss(vbspsys);&lt;/P&gt;&lt;P&gt;if first.usubjid+last.usubjid=2 then output have3;&lt;/P&gt;&lt;P&gt;else output have2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will remove all records with missing results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 19:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208425#M38744</guid>
      <dc:creator>ndp</dc:creator>
      <dc:date>2015-07-23T19:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208426#M38745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;we don't need to remove missing records. records should be removed only for subjects, who don't have any post baseline&amp;nbsp; visits.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 06:10:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208426#M38745</guid>
      <dc:creator>SASFREAK</dc:creator>
      <dc:date>2015-07-24T06:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Subject selection based on if conditional processing.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208427#M38746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data have;&lt;/P&gt;&lt;P&gt;by id descending res vis page&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by id descending res vis page;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain count;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.id then count=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(res) and vis^="DAY0" then count=count+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if count=0 and vis^="DAY0" then delete; **** remove post baseline records if all are misisng;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.id+last.id=2 then delete; *** remove baseline record; if no post baseline;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 14:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subject-selection-based-on-if-conditional-processing/m-p/208427#M38746</guid>
      <dc:creator>ndp</dc:creator>
      <dc:date>2015-07-24T14:10:31Z</dc:date>
    </item>
  </channel>
</rss>

