<?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: if condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634351#M188271</link>
    <description>&lt;P&gt;You need to help us help you by providing sample data (via a working SAS datastep), show the desired result and explain the logic to get from have to want.&lt;/P&gt;
&lt;P&gt;The following code totally based on assumptions and untested.&amp;nbsp; ....and I won't answer any questions unless you provide at least sample data via a data step which I just can copy/paste into a code window and execute.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  if _n_=1 then 
    do;
      if 0 then set b(keep=acc_id col);
      dcl hash h1(dataset:'b(keep=acc_id col where=(col in (' ','NO')))');
      h1.defineKey('acc_id');
      h1.defineDone();
    end;

  set a;
  if sample_id='Serum' and h1.check()=0 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 Mar 2020 07:02:51 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-03-24T07:02:51Z</dc:date>
    <item>
      <title>if condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634346#M188267</link>
      <description>&lt;P&gt;I need output only if below condition satisfies&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output if, Sample ID "Serum" is present in dataset A&amp;nbsp; and (COL) = NO or MISSING in the dataset B for same acc ID.&lt;BR /&gt;Populate NEW_VAR: Sample not collected in B&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 06:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634346#M188267</guid>
      <dc:creator>Vijay77</dc:creator>
      <dc:date>2020-03-24T06:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: if condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634350#M188270</link>
      <description>&lt;P&gt;Please post data in usable form and describe exactly the expected result.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 06:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634350#M188270</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-03-24T06:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: if condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634351#M188271</link>
      <description>&lt;P&gt;You need to help us help you by providing sample data (via a working SAS datastep), show the desired result and explain the logic to get from have to want.&lt;/P&gt;
&lt;P&gt;The following code totally based on assumptions and untested.&amp;nbsp; ....and I won't answer any questions unless you provide at least sample data via a data step which I just can copy/paste into a code window and execute.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  if _n_=1 then 
    do;
      if 0 then set b(keep=acc_id col);
      dcl hash h1(dataset:'b(keep=acc_id col where=(col in (' ','NO')))');
      h1.defineKey('acc_id');
      h1.defineDone();
    end;

  set a;
  if sample_id='Serum' and h1.check()=0 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Mar 2020 07:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/if-condition/m-p/634351#M188271</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-24T07:02:51Z</dc:date>
    </item>
  </channel>
</rss>

