<?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: first visit of id_no in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/first-visit-of-id-no/m-p/101568#M258170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There will be many many ways to do it. The least mind-twisting method (may not be the fastest) is SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; id_no, visit, avg(measurement) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; avg_m &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; id_no, visit;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Oct 2012 17:25:21 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2012-10-19T17:25:21Z</dc:date>
    <item>
      <title>first visit of id_no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-visit-of-id-no/m-p/101567#M258169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input id_no visit measurement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11 1 110&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11 1 120&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11 1 115&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11 2 90&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11 2 89&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22 1 80&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22 1 95&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22 2 90&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22 2 90&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22 2 95&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;26 1 65&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;33 1 95&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;33 1 95&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each visit, we take multiple measurement of the patient. we need to find the average of these measurements for each visit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I run into problem trying to get the first or last visit for the same idno. so the expected output is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;11 1 115&lt;/P&gt;&lt;P&gt;11 2 89.5&lt;/P&gt;&lt;P&gt;22 1 88.3&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 17:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-visit-of-id-no/m-p/101567#M258169</guid>
      <dc:creator>Davidliu494</dc:creator>
      <dc:date>2012-10-19T17:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: first visit of id_no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/first-visit-of-id-no/m-p/101568#M258170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There will be many many ways to do it. The least mind-twisting method (may not be the fastest) is SQL:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; id_no, visit, avg(measurement) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; avg_m &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; have &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt; id_no, visit;&lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 17:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/first-visit-of-id-no/m-p/101568#M258170</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-19T17:25:21Z</dc:date>
    </item>
  </channel>
</rss>

