<?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: For an AE table, how to output maximum severity level so only one person is counted? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834142#M329803</link>
    <description>Hi PeterClemmensen,&lt;BR /&gt;It was put there to show that there were two subjects who had multiple records of soc_term by pt_term. My apologies if it's redundant.</description>
    <pubDate>Mon, 19 Sep 2022 17:51:16 GMT</pubDate>
    <dc:creator>Hello_there</dc:creator>
    <dc:date>2022-09-19T17:51:16Z</dc:date>
    <item>
      <title>For an AE table, how to output maximum severity level so only one person is counted?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834138#M329799</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
length soc_term pt_term $10;
infile datalines dsd dlm=",";
	input subj $ soc_term $ pt_term $ aesevn;
datalines;
001, soc_term1, pt_term1, 1
001, soc_term1, pt_term2, 1
001, soc_term1, pt_term2, 2
001, soc_term1, pt_term3, 1
002, soc_term1, pt_term1, 1
002, soc_term2, pt_term1, 2
002, soc_term2, pt_term3, 3
002, soc_term3, pt_term1, 1
003, soc_term1, pt_term1, 1
003, soc_term2, pt_term1, 1
003, soc_term2, pt_term1, 2
003, soc_term3, pt_term1, 1
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi, i am making an AE table, and a rule i'm supposed to follow is that if a subject has multiple AE events (soc_term by pt_term), i'm supposed to output the record with the maximum severity level. What is the most efficient way to do this?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, subjects 001 and 003 and have multiple records of soc_termX*pt_termX, and i'm only trying to output record with the highest severity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: this table below was produced to show the frequency of soc_terms by pt_terms per subject and this is not the desired result.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hello_there_0-1663609534013.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75375i3E2259C75D696E5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hello_there_0-1663609534013.png" alt="Hello_there_0-1663609534013.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834138#M329799</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-09-19T17:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: For an AE table, how to output maximum severity level so only one person is counted?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834141#M329802</link>
      <description>&lt;P&gt;What is the Proc FREQ output suppose to do here? It is not the desired result, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post your desired result? Makes it easier to provide a usable code answer.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834141#M329802</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-19T17:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: For an AE table, how to output maximum severity level so only one person is counted?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834142#M329803</link>
      <description>Hi PeterClemmensen,&lt;BR /&gt;It was put there to show that there were two subjects who had multiple records of soc_term by pt_term. My apologies if it's redundant.</description>
      <pubDate>Mon, 19 Sep 2022 17:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834142#M329803</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-09-19T17:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: For an AE table, how to output maximum severity level so only one person is counted?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834143#M329804</link>
      <description>&lt;P&gt;No biggie, just wanted to clarify. Is this what you're after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
length soc_term pt_term $10;
infile datalines dsd dlm=",";
	input subj $ soc_term $ pt_term $ aesevn;
datalines;
001, soc_term1, pt_term1, 1
001, soc_term1, pt_term2, 1
001, soc_term1, pt_term2, 2
001, soc_term1, pt_term3, 1
002, soc_term1, pt_term1, 1
002, soc_term2, pt_term1, 2
002, soc_term2, pt_term3, 3
002, soc_term3, pt_term1, 1
003, soc_term1, pt_term1, 1
003, soc_term2, pt_term1, 1
003, soc_term2, pt_term1, 2
003, soc_term3, pt_term1, 1
;

proc sql;
   create table want as
   select * from have1
   group by subj, soc_term, pt_term
   having max(aesevn) = aesevn
   ;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834143#M329804</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-19T17:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: For an AE table, how to output maximum severity level so only one person is counted?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834144#M329805</link>
      <description>Thanks, this worked beautifully!</description>
      <pubDate>Mon, 19 Sep 2022 17:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834144#M329805</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-09-19T17:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: For an AE table, how to output maximum severity level so only one person is counted?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834145#M329806</link>
      <description>&lt;P&gt;Glad you found your answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/For-an-AE-table-how-to-output-maximum-severity-level-so-only-one/m-p/834145#M329806</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-19T17:59:16Z</dc:date>
    </item>
  </channel>
</rss>

