<?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: Summary in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summary/m-p/644558#M192536</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;how would I create a summary to show the following:&lt;/P&gt;
&lt;P&gt;1IS53 for e.g. is in my syntax, so for all the records that have 1IS53 as an intervention what is the average and median&amp;nbsp; (duration)&lt;/P&gt;
&lt;P&gt;Intervention&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Duration&lt;/P&gt;
&lt;P&gt;1IS53&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use PROC SUMMARY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway data=Vas_DAD1819_Sum;
    class intervation;
    var duration;
    output out=want mean= median= / autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 May 2020 16:45:22 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-05-01T16:45:22Z</dc:date>
    <item>
      <title>Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary/m-p/644556#M192535</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Vas_DAD1819_Sum; set test.DAD1819;
 
array int_code[20] INTERV_CODE_01 - INTERV_CODE_20;
 
array ooh[20] INTERV_OOH_IND_01 - INTERV_OOH_IND_20;
 
array status[20] INTERV_STATUS_ATTRIB_01 - INTERV_STATUS_ATTRIB_20;
 
array location[20] INTERV_OR_LOC_01 - INTERV_OR_LOC_20;
 
array duration[20] INTERV_EPISODE_DURATION_01 - INTERV_EPISODE_DURATION_20;
 
Vascular=0;
 
do i=1 to 20;
 
if substr(int_code[i], 1, 5) in : ('1VC91','1VC93', '1VX59', '1DA89', '1ET89', '1TK93', '1TV93', '1TX59', '1UE93', 
 
'1UF93', '1UI93', '1UJ93', '1UY59', '1WK93', '1WL93', '1WV59', '1JX87','1KA50', '1KA53', '1KA76', '1KA80', '1IA80',
 
'1IB57', '1IB80', '1ID57', '1ID76', '1ID80', '1ID86', '1ID87', '1JE80', '1JE87', '1JM80', '1JM87', '1JX87', '1KA50',
 
'1KA82', '1KE80', '1KG50','1KG80', '1KA76', '1KG51', '1KG57', '1KG76', '1KG80', '1KG82', '1KG87', '1JE76',
 
'1JJ76', '1JK76', '1KA76', '1KT51', '1KT76', '1KY76', '1JE57', '1JD59', '1JJ50', '1JJ51', '1JJ57', '1JJ80',
 
'1JK80', '1JM50', '1JM51', '1JM57', '1JM80', '1JM82', '1JM87', '1JW86', '1KG50', '1KG51', '1KG57', '1KG80', '1KG87', '1KT50',
 
'1KT51', '1KT80', '1KV13', '1KY50', '1KY57', '1KY76', '1KY80', '1KZ51', '1KZ86', '1SZ52', '1IC50', '1IC76', '1IC80', '1IC87',
 
'1KA57', '1KA87', '1KE50', '1KE51', '1KE57', '1KE76', '1KE87', '1NV89', '1IS53', '1JQ80', '1JU51', '1JU57', '1JU80', '1JU87','1JW86',
 
'1KQ80', '1KR50', '1KR51', '1KR57', '1KR58', '1KR59', '1KR76', '1KR80', '1KR87', '1KZ86')
 
and ooh[i]~='Y'  and status[i]~='A' and location[i] = '01'   then do;
Vascular=1;
dur=duration(i);
output;
end;
 
end;
 
drop i;
 
if Province_Issuing_HCN='ON' and Responsibility_for_Payment='01' and hcn_index='H'
 
and Age &amp;gt;=18
 
and hcne^='9999999999' 
 
and gender in ('M' , 'F') then output;
 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I just checked one record and I note that the intervention of interest is present in position 4 but the OR_LOC is not equal to 1 but the vascular is still equal to 1&lt;/P&gt;&lt;P&gt;Would you be able to advise why?&lt;/P&gt;&lt;P&gt;In addition,&amp;nbsp; how would I create a summary to show the following:&lt;/P&gt;&lt;P&gt;1IS53 for e.g. is in my syntax, so for all the records that have 1IS53 as an intervention what is the average and median&amp;nbsp; (duration)&lt;/P&gt;&lt;P&gt;Intervention&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Duration&lt;/P&gt;&lt;P&gt;1IS53&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 16:32:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary/m-p/644556#M192535</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-05-01T16:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Summary</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary/m-p/644558#M192536</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;how would I create a summary to show the following:&lt;/P&gt;
&lt;P&gt;1IS53 for e.g. is in my syntax, so for all the records that have 1IS53 as an intervention what is the average and median&amp;nbsp; (duration)&lt;/P&gt;
&lt;P&gt;Intervention&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Duration&lt;/P&gt;
&lt;P&gt;1IS53&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use PROC SUMMARY.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway data=Vas_DAD1819_Sum;
    class intervation;
    var duration;
    output out=want mean= median= / autoname;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 May 2020 16:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary/m-p/644558#M192536</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-01T16:45:22Z</dc:date>
    </item>
  </channel>
</rss>

