<?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: Multiple conditions on renaming observations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445556#M111667</link>
    <description>&lt;P&gt;Most likely the best way, I was unsure how format can be used for an umbrella "other" term thank you&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 17:35:49 GMT</pubDate>
    <dc:creator>89974114</dc:creator>
    <dc:date>2018-03-14T17:35:49Z</dc:date>
    <item>
      <title>Multiple conditions on renaming observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445552#M111663</link>
      <description>&lt;P&gt;I am wondering if there is any very clever way of renaming the observations in a variable according to the frequency they appear, it has been a bit of a brain teaser for me today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imagine having the dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;


set have;


input ID Business $;


datalines;

1 Retail
2 Corporate
3 Retail
4 Retail
5 Retail
6 Corporate
7 SME
8 Retail
9 Retail
10 Corporate
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there any way that you can change observations in the business variable if there is less than 10% representation in the variable&lt;BR /&gt;&lt;BR /&gt;I.e. in a proc freq - variable SME would account for 10%, would there possibly be a code to say&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

if business(Obs)&amp;lt;10% then business="Other";

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's sounding a little far fetched but if this is not possible, my question is can I have multiple constraints on the statement below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

if Business^= "Retail" or "Corporate"
then Business = "Other";

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 17:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445552#M111663</guid>
      <dc:creator>89974114</dc:creator>
      <dc:date>2018-03-14T17:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions on renaming observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445555#M111666</link>
      <description>&lt;P&gt;What about a custom format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID Business $15.;
datalines;
1 Retail
2 Corporate
3 Retail
4 Retail
5 Retail
6 Corporate
7 SME
8 Retail
9 Retail
10 Corporate
;
run;

proc format;
value $ business_type_fmt
'Retail' = 'Retail'
'Corporate' = 'Corporate'
other = 'Other';
run;

proc freq data=have;
table business;
format business $business_type_fmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 17:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445555#M111666</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-14T17:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple conditions on renaming observations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445556#M111667</link>
      <description>&lt;P&gt;Most likely the best way, I was unsure how format can be used for an umbrella "other" term thank you&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 17:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-conditions-on-renaming-observations/m-p/445556#M111667</guid>
      <dc:creator>89974114</dc:creator>
      <dc:date>2018-03-14T17:35:49Z</dc:date>
    </item>
  </channel>
</rss>

