<?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: SAS code for selecting lab value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609507#M177464</link>
    <description>any sample data would help for better response</description>
    <pubDate>Wed, 04 Dec 2019 20:01:28 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2019-12-04T20:01:28Z</dc:date>
    <item>
      <title>SAS code for selecting lab value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609491#M177459</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have eGFR data with multiple eGFR values per patient. And I want to select the eGFR value closest to diagnosis date (+-2 months). And for patients with multiple values in +-2 months period I want to select the eGFR value prior to diagnosis and closest to diagnosis date. I am not able to write the code for the "elect the eGFR value prior to diagnosis and closest to diagnosis ". Appreciate any help I can get.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Y;&lt;BR /&gt;set X;&lt;BR /&gt;CalCreDiff=eGFRdate-DX_DATE;&lt;BR /&gt;AbsCaleGFRDiff=abs(CalCreDiff);&lt;BR /&gt;if -60&amp;lt;=AbseCaleGFRDiff=&amp;lt;60;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2019 19:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609491#M177459</guid>
      <dc:creator>RM121</dc:creator>
      <dc:date>2019-12-04T19:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for selecting lab value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609507#M177464</link>
      <description>any sample data would help for better response</description>
      <pubDate>Wed, 04 Dec 2019 20:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609507#M177464</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-12-04T20:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code for selecting lab value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609555#M177482</link>
      <description>&lt;P&gt;The code you are attempting is about 2 lines longer than it needs to be. Unless you later that need one or more of the AbsCaleGFRDiff or CalCreDiff variables then do the arithmetic inside the ABS function.&lt;/P&gt;
&lt;P&gt;Also you only need one side for the comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   input x y;
   if abs(x - y) le 60 then put "Between -60 and 60";
   else put "Out of range";
datalines;
120  60
120  59
120  61
0   -61
0   -60
0   -59
;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2019 22:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-for-selecting-lab-value/m-p/609555#M177482</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-04T22:20:58Z</dc:date>
    </item>
  </channel>
</rss>

