<?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 Specifying a set of ICD codes with corresponding categories into single column. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478190#M123282</link>
    <description>&lt;P&gt;I have clams data with diagnosis column DX1 to DX15 which stores ICD9 codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a categorical combined variable (Premature here) where DxLabel is category and icd9 is the corresponding code.&lt;/P&gt;&lt;P&gt;Such pairs could be different each time, may be 4 once, may be 40 next time. Hence I want to be able to only modify two&amp;nbsp;arrays and get the categories situated in one column-(here Premature)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following code&amp;nbsp;does not work and can someone help me fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let ColName = Premature;&lt;BR /&gt;data RSLTTBL; /* This is the name of result table */&lt;BR /&gt;set PLYGRND.kid_2006; /* Copy table from this table */&lt;BR /&gt;array diagcol(*) DX1-DX15; /* Define arrary of Diagnosis columns */&lt;BR /&gt;array icd9(4) _TEMPORARY_ (76520 76521 76522 76523);&lt;BR /&gt;array Dxlabel(4)&amp;nbsp;Unspecified LessthanGA24 GA24 GA2526;&lt;BR /&gt;length &amp;amp;ColName $10; /* Define new variable */&lt;BR /&gt;&amp;amp;ColName="None"; /*Assign Value to new variable*/&lt;/P&gt;&lt;P&gt;do i=1 to dim(icd9);&lt;BR /&gt;if whichn(icd9[i],of diagcol(*))&amp;gt;0 then &amp;amp;ColName=Dxlabel[i]; /*Assign Value to new variable ---I think the problem is here.*/&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=rslttbl;&lt;BR /&gt;tables Premature;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Jul 2018 11:12:19 GMT</pubDate>
    <dc:creator>doc4child</dc:creator>
    <dc:date>2018-07-15T11:12:19Z</dc:date>
    <item>
      <title>Specifying a set of ICD codes with corresponding categories into single column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478190#M123282</link>
      <description>&lt;P&gt;I have clams data with diagnosis column DX1 to DX15 which stores ICD9 codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a categorical combined variable (Premature here) where DxLabel is category and icd9 is the corresponding code.&lt;/P&gt;&lt;P&gt;Such pairs could be different each time, may be 4 once, may be 40 next time. Hence I want to be able to only modify two&amp;nbsp;arrays and get the categories situated in one column-(here Premature)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following code&amp;nbsp;does not work and can someone help me fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let ColName = Premature;&lt;BR /&gt;data RSLTTBL; /* This is the name of result table */&lt;BR /&gt;set PLYGRND.kid_2006; /* Copy table from this table */&lt;BR /&gt;array diagcol(*) DX1-DX15; /* Define arrary of Diagnosis columns */&lt;BR /&gt;array icd9(4) _TEMPORARY_ (76520 76521 76522 76523);&lt;BR /&gt;array Dxlabel(4)&amp;nbsp;Unspecified LessthanGA24 GA24 GA2526;&lt;BR /&gt;length &amp;amp;ColName $10; /* Define new variable */&lt;BR /&gt;&amp;amp;ColName="None"; /*Assign Value to new variable*/&lt;/P&gt;&lt;P&gt;do i=1 to dim(icd9);&lt;BR /&gt;if whichn(icd9[i],of diagcol(*))&amp;gt;0 then &amp;amp;ColName=Dxlabel[i]; /*Assign Value to new variable ---I think the problem is here.*/&lt;BR /&gt;end;&lt;BR /&gt;drop i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=rslttbl;&lt;BR /&gt;tables Premature;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 11:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478190#M123282</guid>
      <dc:creator>doc4child</dc:creator>
      <dc:date>2018-07-15T11:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying a set of ICD codes with corresponding categories into single column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478200#M123289</link>
      <description>&lt;P&gt;The DxLabel array contains 4 numeric variables named&amp;nbsp;&lt;SPAN&gt;Unspecified LessthanGA24 GA24 and GA2526.&amp;nbsp; Perhaps you meant to define a temporary array with the elements "Unspecified"&amp;nbsp; "LessthanGA24"&amp;nbsp; "GA24"&amp;nbsp; and&amp;nbsp;"GA2526".&amp;nbsp; (If that's the case, a length of $10 for &amp;amp;ColName might not be long enough.)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;At any rate, it's all a guess.&amp;nbsp; You would need to describe what "does not work" actually means to get a more specific answer.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 13:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478200#M123289</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-15T13:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying a set of ICD codes with corresponding categories into single column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478209#M123290</link>
      <description>&lt;P&gt;Thanks for reply label(DxLabel[i]) solved the issue. Thanks anyway&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2018 15:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Specifying-a-set-of-ICD-codes-with-corresponding-categories-into/m-p/478209#M123290</guid>
      <dc:creator>doc4child</dc:creator>
      <dc:date>2018-07-15T15:12:22Z</dc:date>
    </item>
  </channel>
</rss>

