<?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: Dataset categorized column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309612#M66678</link>
    <description>&lt;P&gt;Anytime. Please mark my answer as a solution if it solved your problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Regards.&lt;/P&gt;</description>
    <pubDate>Sun, 06 Nov 2016 18:58:31 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2016-11-06T18:58:31Z</dc:date>
    <item>
      <title>Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309599#M66666</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;Hello! I'm starting with sas base and I have a question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;I'm not able to find the way to create a new column which categorizes different words form other column in the same dataset.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;I need to create a column (named category)&lt;SPAN class="apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;with&amp;nbsp;3 different variables: "Clothes", "Bags" and "Other". So when the main column says t-shirt in the new category colum would say "clothes" if it says shoes the new columns would say other, etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;Clothes would search words like t-shirts, hats, etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;bags would search bagpacks, packs, etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;and other the rest of words&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica Neue'; color: #333333;"&gt;Thank you for the help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309599#M66666</guid>
      <dc:creator>fconerj</dc:creator>
      <dc:date>2016-11-06T18:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309601#M66668</link>
      <description>&lt;P&gt;Something like this? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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 main_column in ('T-Shirt' /*, Insert other types of clothes here separated by , */) then do;
      new_column = 'Clothes';
   end;
   else if main_column in ('Shoes') then do;
      new_column = 'Other';
   end;
   else if main_column in ('Some Bags Name') then do;
      new_column = 'Bags';
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:33:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309601#M66668</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-06T18:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309605#M66671</link>
      <description />
      <pubDate>Sun, 06 Nov 2016 18:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309605#M66671</guid>
      <dc:creator>mcarmona</dc:creator>
      <dc:date>2016-11-06T18:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309606#M66672</link>
      <description>&lt;P&gt;Not sure I understand completely, but you can put as many words inside the parenthesis as you want as below? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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 main_column in ('T-Shirt' /*, Insert other types of clothes here separated by , */) then do;
      new_column = 'Clothes';
   end;
   else if main_column in ('Shoes', 'Socks', 'Ties') then do;
      new_column = 'Other';
   end;
   else if main column in ('Some Bags Name') then do;
      new_column = 'Bags';
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309606#M66672</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-06T18:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309607#M66673</link>
      <description>I know, thank you again for your fast reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I mean, imagine you have 1000 words to put in the parenthesis, is there a way to say this;&lt;BR /&gt;&lt;BR /&gt;T-shirts, hoodies, hats = clothes&lt;BR /&gt;bags, backpacks = bags&lt;BR /&gt;all the rest of the words = other ?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309607#M66673</guid>
      <dc:creator>fconerj</dc:creator>
      <dc:date>2016-11-06T18:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309609#M66675</link>
      <description>&lt;P&gt;Ah, now I get it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Sure:&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 main_column in ('T-shirts', 'hoodies', 'hats') then do;
      new_column = 'Clothes';
   end;
   else if main_column in ('bags', 'backpacks') then do;
      new_column = 'Bags';
   end;
   else do;
      new_column = 'Other';
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309609#M66675</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-06T18:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309610#M66676</link>
      <description>that's great, thank you! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309610#M66676</guid>
      <dc:creator>fconerj</dc:creator>
      <dc:date>2016-11-06T18:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309611#M66677</link>
      <description>&lt;P&gt;Be aware of handling different cases of text like this:&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 lowcase(main_column) in ('t-shirts', 'hoodies', 'hats') then do;
      new_column = 'Clothes';
   end;
   else if lowcase(main_column) in ('bags', 'backpacks') then do;
      new_column = 'Bags';
   end;
   else do;
      new_column = 'Other';
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:57:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309611#M66677</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-06T18:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dataset categorized column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309612#M66678</link>
      <description>&lt;P&gt;Anytime. Please mark my answer as a solution if it solved your problem &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Regards.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 18:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dataset-categorized-column/m-p/309612#M66678</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-06T18:58:31Z</dc:date>
    </item>
  </channel>
</rss>

