<?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 Issue with my code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Issue-with-my-code/m-p/947710#M370951</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a problem with this code; I don't understand why it does not pick fire-related incidents.&lt;BR /&gt;Steps a and b are to show whether the hospitalization is related to CO poisoning yes or no&lt;BR /&gt;step c is to identify fire-related CO poisoning; I think either step c or step f has a problem, but I am not sure what it is because I expect to see fire-related incidents, but as it is, it returns nothing for fire-related incidents.&lt;BR /&gt;All other parts seem to be working well!&lt;BR /&gt;If anyone can identify something that may be off, I would appreciate it!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;* sub-step A;
substr(dx18,1,5) in ('T5801', 'T5804', 'T5811', 'T5814', 'T5891', 'T5894') or substr(dx17,1,6) in ('T582X1', 'T582X4', 'T588X1', 'T588X4') then COyes_step2a10 = 1;
* sub-step B;
substr(dx18,1,5) in ('T5802', 'T5803', 'T5812', 'T5813', 'T5892', 'T5893') or substr(dx17,1,6) in ('T582X2', 'T582X3', 'T588X2', 'T588X3') then COno_step2b10 = 1;

if COyes_step2a10 = 1 and COno_step2b10 ~= 1 then COpoisoning = 1;

* sub-step c;
substr(dx18,1,3) in ('X00', 'X01', 'X02', 'X03', 'X04', 'X05', 'X06', 'X08') then CO_fire10 = 1;
 
* sub-step d;
substr(dx18,1,5) in ('T5801', 'T5811', 'T5891') or substr(dx17,1,6) in ('T582X1', 'T588X1') then CO_nonfire_prelim10 = 1; 

if CO_fire10 ~= 1 and CO_nonfire_prelim10 = 1 then CO_nonfire10 = 1;

* sub-step e;

substr(dx18,1,5) in ('T5804', 'T5814', 'T5894') or substr(dx17,1,6) in ('T582X4', 'T588X4') then CO_unknown_prelim1_10 = 1;

if CO_fire10 ~= 1 and CO_unknown_prelim1_10 = 1 then CO_unknown_prelim2_10 = 1;
		if CO_fire10 = 1 and CO_nonfire10 = 1 then CO_unknown_prelim3_10 = 1;
		if CO_unknown_prelim2_10 = 1 or CO_unknown_prelim3_10 = 1 then CO_unknown10 = 1;

		* sub-step f;
		if CO_fire10 = 1 then Cause = 1;*fire related ;
		if CO_nonfire10 = 1 then Cause = 2;*not fire related;
		if CO_unknown10 = 1 then Cause = 3;*Unknown mechanism or intent;
			if CO_fire10 = 1 and CO_nonfire10 = 1 then Cause = 3;
			if CO_fire10 = 1 and CO_unknown10 = 1 then Cause = 3;
			if CO_nonfire10 = 1 and CO_unknown10 = 1 then Cause = 3;
          HealthOutcomeID=3;
          MonthlyHosp=0;
			run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Oct 2024 16:40:49 GMT</pubDate>
    <dc:creator>Fadams12</dc:creator>
    <dc:date>2024-10-16T16:40:49Z</dc:date>
    <item>
      <title>Issue with my code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-with-my-code/m-p/947710#M370951</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a problem with this code; I don't understand why it does not pick fire-related incidents.&lt;BR /&gt;Steps a and b are to show whether the hospitalization is related to CO poisoning yes or no&lt;BR /&gt;step c is to identify fire-related CO poisoning; I think either step c or step f has a problem, but I am not sure what it is because I expect to see fire-related incidents, but as it is, it returns nothing for fire-related incidents.&lt;BR /&gt;All other parts seem to be working well!&lt;BR /&gt;If anyone can identify something that may be off, I would appreciate it!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;* sub-step A;
substr(dx18,1,5) in ('T5801', 'T5804', 'T5811', 'T5814', 'T5891', 'T5894') or substr(dx17,1,6) in ('T582X1', 'T582X4', 'T588X1', 'T588X4') then COyes_step2a10 = 1;
* sub-step B;
substr(dx18,1,5) in ('T5802', 'T5803', 'T5812', 'T5813', 'T5892', 'T5893') or substr(dx17,1,6) in ('T582X2', 'T582X3', 'T588X2', 'T588X3') then COno_step2b10 = 1;

if COyes_step2a10 = 1 and COno_step2b10 ~= 1 then COpoisoning = 1;

* sub-step c;
substr(dx18,1,3) in ('X00', 'X01', 'X02', 'X03', 'X04', 'X05', 'X06', 'X08') then CO_fire10 = 1;
 
* sub-step d;
substr(dx18,1,5) in ('T5801', 'T5811', 'T5891') or substr(dx17,1,6) in ('T582X1', 'T588X1') then CO_nonfire_prelim10 = 1; 

if CO_fire10 ~= 1 and CO_nonfire_prelim10 = 1 then CO_nonfire10 = 1;

* sub-step e;

substr(dx18,1,5) in ('T5804', 'T5814', 'T5894') or substr(dx17,1,6) in ('T582X4', 'T588X4') then CO_unknown_prelim1_10 = 1;

if CO_fire10 ~= 1 and CO_unknown_prelim1_10 = 1 then CO_unknown_prelim2_10 = 1;
		if CO_fire10 = 1 and CO_nonfire10 = 1 then CO_unknown_prelim3_10 = 1;
		if CO_unknown_prelim2_10 = 1 or CO_unknown_prelim3_10 = 1 then CO_unknown10 = 1;

		* sub-step f;
		if CO_fire10 = 1 then Cause = 1;*fire related ;
		if CO_nonfire10 = 1 then Cause = 2;*not fire related;
		if CO_unknown10 = 1 then Cause = 3;*Unknown mechanism or intent;
			if CO_fire10 = 1 and CO_nonfire10 = 1 then Cause = 3;
			if CO_fire10 = 1 and CO_unknown10 = 1 then Cause = 3;
			if CO_nonfire10 = 1 and CO_unknown10 = 1 then Cause = 3;
          HealthOutcomeID=3;
          MonthlyHosp=0;
			run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2024 16:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-with-my-code/m-p/947710#M370951</guid>
      <dc:creator>Fadams12</dc:creator>
      <dc:date>2024-10-16T16:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with my code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Issue-with-my-code/m-p/947722#M370955</link>
      <description>&lt;P&gt;I suspect you meant those first few to be &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1j60arf27ll4nn1ejavv3nby4pa.htm" target="_self"&gt;IF/THEN/ELSE statements&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Not &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0uev77ebdwy90n1rsd7hwjd2qc3.htm" target="_self"&gt;SUBSTR() = statements&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 17:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Issue-with-my-code/m-p/947722#M370955</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-10-16T17:57:12Z</dc:date>
    </item>
  </channel>
</rss>

