<?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: Some simple counting help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48042#M12951</link>
    <description>Have a look at the DOC.  Here are two examples:&lt;BR /&gt;
&lt;BR /&gt;
select(injgrp);&lt;BR /&gt;
  when('A','B','C') some_other_var = '1';&lt;BR /&gt;
  when('D','E') some_other_var = '2';&lt;BR /&gt;
  otherwise do;  &lt;BR /&gt;
    putlog '&amp;gt;diag99&amp;gt; No match found for ' injgrp=;&lt;BR /&gt;
  end;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
select;&lt;BR /&gt;
  when( injgrp in ('A','B','C') ) some_other_var = '1';&lt;BR /&gt;
  when( injgrp in ('D','E') ) some_other_var = '2';&lt;BR /&gt;
  * with no otherwise, SAS will generate error on no-match. ;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Thu, 18 Sep 2008 19:12:55 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2008-09-18T19:12:55Z</dc:date>
    <item>
      <title>Some simple counting help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48039#M12948</link>
      <description>Hello. I am trying to group traffic crash injury severity into a new variable.&lt;BR /&gt;
&lt;BR /&gt;
Basically, my current severity variable is coded as:&lt;BR /&gt;
'0'= no injury&lt;BR /&gt;
'1'=minor injury&lt;BR /&gt;
'2'=moderat injury&lt;BR /&gt;
'3'=major injury&lt;BR /&gt;
'4'=major injury unconcious&lt;BR /&gt;
'5'=fatal injury&lt;BR /&gt;
&lt;BR /&gt;
Now, I want to determine a way to group these as follows:&lt;BR /&gt;
&lt;BR /&gt;
New Variable, coded either 'A','B','C','D','None', where:&lt;BR /&gt;
&lt;BR /&gt;
A= anything from original code that was found in '1','2','3','4','5'&lt;BR /&gt;
B='2','3','4','5'&lt;BR /&gt;
C='3','4','5'&lt;BR /&gt;
D='5'&lt;BR /&gt;
None='0'&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to recode the original variable, say it's called INJ (coded '0','1','2','3','4','5'), to the new variable, say INJGRP(coded 'A','B','C','D','None')&lt;BR /&gt;
&lt;BR /&gt;
Thanks to anyone that can provide me with some help</description>
      <pubDate>Thu, 18 Sep 2008 17:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48039#M12948</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-18T17:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Some simple counting help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48040#M12949</link>
      <description>A DATA step SELECT/WHEN/OTHERWISE/END construct would be suitable.  Also, for less DATA step coding, consider using a SAS PROC FORMAT and a PUT function in a DATA step to map your data values to a higher-level grouping.&lt;BR /&gt;
&lt;BR /&gt;
You will find DOC and technical paper references at the SAS support website  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  or with the Google advanced search argument below:&lt;BR /&gt;
&lt;BR /&gt;
proc format put function site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 18 Sep 2008 17:37:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48040#M12949</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-18T17:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Some simple counting help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48041#M12950</link>
      <description>thanks for the help. Would this coding allow me to re-analyze the new variable, for ex/&lt;BR /&gt;
&lt;BR /&gt;
in INJGRP=A then, else INJGRP=B etc...</description>
      <pubDate>Thu, 18 Sep 2008 19:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48041#M12950</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-18T19:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Some simple counting help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48042#M12951</link>
      <description>Have a look at the DOC.  Here are two examples:&lt;BR /&gt;
&lt;BR /&gt;
select(injgrp);&lt;BR /&gt;
  when('A','B','C') some_other_var = '1';&lt;BR /&gt;
  when('D','E') some_other_var = '2';&lt;BR /&gt;
  otherwise do;  &lt;BR /&gt;
    putlog '&amp;gt;diag99&amp;gt; No match found for ' injgrp=;&lt;BR /&gt;
  end;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
select;&lt;BR /&gt;
  when( injgrp in ('A','B','C') ) some_other_var = '1';&lt;BR /&gt;
  when( injgrp in ('D','E') ) some_other_var = '2';&lt;BR /&gt;
  * with no otherwise, SAS will generate error on no-match. ;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 18 Sep 2008 19:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Some-simple-counting-help/m-p/48042#M12951</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-18T19:12:55Z</dc:date>
    </item>
  </channel>
</rss>

