<?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: Array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644548#M192529</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 modified the SAS code above&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate if you can advise why vascular is 1 when i have for e.g. an int code present and the OR location is not equal to 1 but still vascular is equal to 1&amp;nbsp;&lt;/P&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 duration&lt;/P&gt;&lt;P&gt;Intervention&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Duration avg&amp;nbsp; &amp;nbsp;Duration Median&amp;nbsp;&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&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 May 2020 15:40:29 GMT</pubDate>
    <dc:creator>Ranjeeta</dc:creator>
    <dc:date>2020-05-01T15:40:29Z</dc:date>
    <item>
      <title>Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644424#M192472</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data Vas_DAD1819; set test.DAD1819;
array int_code[20] INTERV_CODE_01 - INTERV_CODE_20;
array ooh[20] INTERV_OOH_IND_01 - INTERV_OOH_IND_20;
Vascular=0;
do i=1 to 20;
if int_code[i] in ('1VC91','1VC93')
and ooh[i]~='Y' then Vascular=1;
end;
drop i;
if Vascular=1;
/*if Province_Issuing_HCN='ON' and Responsibility_for_Payment='01' and hcn_index='H'
and Age &amp;gt;=18
and hcn_Encrypted_DAR^='9999999999' */
;
run; 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would appreciate if you can help me with the foll query:&lt;/P&gt;&lt;P&gt;How would I modify the query above so that only he first 5 digits of the 20 fields INTERV_CODE_01 - INTERV_CODE_20 Are checked&lt;BR /&gt;substr (INTERV_CODE_01,1,5) I probably need to put this in the syntax above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your advice&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 01:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644424#M192472</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-05-01T01:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644429#M192474</link>
      <description>&lt;LI-CODE lang="markup"&gt;if substr(int_code[i], 1, 5) in ('1VC91','1VC93')&lt;/LI-CODE&gt;
&lt;P&gt;or try the following option as well, note the addition of the colon ( : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if int_code[i] in: ('1VC91','1VC93')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240770"&gt;@Ranjeeta&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data Vas_DAD1819; set test.DAD1819;
array int_code[20] INTERV_CODE_01 - INTERV_CODE_20;
array ooh[20] INTERV_OOH_IND_01 - INTERV_OOH_IND_20;
Vascular=0;
do i=1 to 20;
if int_code[i] in ('1VC91','1VC93')
and ooh[i]~='Y' then Vascular=1;
end;
drop i;
if Vascular=1;
/*if Province_Issuing_HCN='ON' and Responsibility_for_Payment='01' and hcn_index='H'
and Age &amp;gt;=18
and hcn_Encrypted_DAR^='9999999999' */
;
run; 

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would appreciate if you can help me with the foll query:&lt;/P&gt;
&lt;P&gt;How would I modify the query above so that only he first 5 digits of the 20 fields INTERV_CODE_01 - INTERV_CODE_20 Are checked&lt;BR /&gt;substr (INTERV_CODE_01,1,5) I probably need to put this in the syntax above&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your advice&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 01:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644429#M192474</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-01T01:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644460#M192489</link>
      <description>&lt;P&gt;Are you asking for:&lt;/P&gt;
&lt;PRE&gt;do i=1 to 20;
   if substr(int_code[i],1,5) in ('1VC91','1VC93')
   and ooh[i]~='Y' then Vascular=1;
end;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 May 2020 06:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644460#M192489</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-01T06:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644508#M192509</link>
      <description>Thankyou</description>
      <pubDate>Fri, 01 May 2020 13:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644508#M192509</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-05-01T13:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644509#M192510</link>
      <description>thankyuoy</description>
      <pubDate>Fri, 01 May 2020 13:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644509#M192510</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-05-01T13:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644548#M192529</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 modified the SAS code above&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate if you can advise why vascular is 1 when i have for e.g. an int code present and the OR location is not equal to 1 but still vascular is equal to 1&amp;nbsp;&lt;/P&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 duration&lt;/P&gt;&lt;P&gt;Intervention&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Duration avg&amp;nbsp; &amp;nbsp;Duration Median&amp;nbsp;&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&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 15:40:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644548#M192529</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-05-01T15:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644560#M192538</link>
      <description>&lt;P&gt;You will need to show examples of the data values of the int_code, ooh, status and location that are getting a value of Vascular that you think is incorrect. Your comparison involves all 4 values.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 16:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644560#M192538</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-01T16:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644568#M192542</link>
      <description>&lt;P&gt;please find attached the code highlighted in yellow is the code of interest in position 4 but the OR Location is not equal to 01&amp;nbsp; but vascular is populated as 1&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure why ?&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 17:50:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array/m-p/644568#M192542</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2020-05-01T17:50:57Z</dc:date>
    </item>
  </channel>
</rss>

