<?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: Creating Consistent Categories in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763339#M241745</link>
    <description>&lt;P&gt;This turns out to be an educational problem for myself.&amp;nbsp; There is a format for converting numbers to roman numerals, there is no such informat, switching back.&amp;nbsp; Without a way to convert roman numerals to numbers, how will the categories be sorted?&amp;nbsp; I haven't given up, but I did not read that this was mentioned, so now its mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but cty goes to (i) and targ to (iii) always, even if the numeral is wrong, so ok that means it doesn't matter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I think I should know how to read in roman numerals from a text file.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Aug 2021 19:51:31 GMT</pubDate>
    <dc:creator>PhilC</dc:creator>
    <dc:date>2021-08-23T19:51:31Z</dc:date>
    <item>
      <title>Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763278#M241714</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a dataset with categories in different order. I want to create a consistency in the order as&amp;nbsp; [(i)cyt, (ii) end therapy, (iii) targ]. Also delete the (i),(ii), and (iii).&lt;/P&gt;
&lt;P&gt;Different versions are [(ii)cyt, (iii) targ, (ii) end therapy], [(iii)end therapy, (i) cyt, (iii) targ], etc. Please see the data below. Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data Have:&lt;/P&gt;
&lt;TABLE width="272"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="208"&gt;Categories&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;(ii)cyt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;(iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;(ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data Want:&lt;/P&gt;
&lt;TABLE width="425"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="208"&gt;Categories&lt;/TD&gt;
&lt;TD width="153"&gt;Clean_Category&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;(ii)cyt&lt;/TD&gt;
&lt;TD&gt;Cyt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;(iii) targ&lt;/TD&gt;
&lt;TD&gt;Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;(ii) end therapy&lt;/TD&gt;
&lt;TD&gt;End Therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines dlm=':';
   input ID Categories :$100.;
 datalines;
1:(i)cyt,(ii)end therapy,(iii)targ
2:(ii)cyt,(iii)targ,(ii)end therapy
3:(iii)end therapy,(i)cyt,(iii)targ
4:iii)targ,(i)cyt,(ii)end therapy
5:(iii)end therapy,(i)cyt,(iii)targ
6:iii)targ,(i)cyt,(ii)end therapy
7:(i)cyt,(ii)end therapy,(iii)targ
8:(ii)cyt,(iii)targ,(ii)end therapy
9:(ii)cyt
10:(iii)targ
11:(ii)end therapy
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Aug 2021 17:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763278#M241714</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2021-08-23T17:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763284#M241718</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/336862"&gt;@newsas007&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a dataset with categories in different order. I want to create a consistency in the order as&amp;nbsp; [(i)cyt, (ii) end therapy, (iii) targ]. Also delete the (i),(ii), and (iii).&lt;/P&gt;
&lt;P&gt;Different versions are [(ii)cyt, (iii) targ, (ii) end therapy], [(iii)end therapy, (i) cyt, (iii) targ], etc. Please see the data below. Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data Have:&lt;/P&gt;
&lt;TABLE width="272"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="208"&gt;Categories&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;(ii)cyt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;(iii) targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;(ii) end therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data Want:&lt;/P&gt;
&lt;TABLE width="425"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;ID&lt;/TD&gt;
&lt;TD width="208"&gt;Categories&lt;/TD&gt;
&lt;TD width="153"&gt;Clean_Category&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;TD&gt;(iii)end therapy, (i) cyt, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;iii) targ, (i) cyt, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;(i)cyt, (ii) end therapy, (iii) targ&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;TD&gt;(ii)cyt, (iii) targ, (ii) end therapy&lt;/TD&gt;
&lt;TD&gt;Cyt, End Therapy, Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;TD&gt;(ii)cyt&lt;/TD&gt;
&lt;TD&gt;Cyt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;10&lt;/TD&gt;
&lt;TD&gt;(iii) targ&lt;/TD&gt;
&lt;TD&gt;Targ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;(ii) end therapy&lt;/TD&gt;
&lt;TD&gt;End Therapy&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would start with something like this (untested code a I don't have a data set to work with)&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   length Clean_category $ 30;
   if index(categories,'cyt')&amp;gt;0 then Clean_category='CYT';
   if index(categories,'end therapy')&amp;gt;0 then Clean_category=catx(', ',Clean_category,'End Therapy');
   if index(categories,'targ')&amp;gt;0 then Clean_category=catx(', ',Clean_category,'Targ');
run;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Aug 2021 16:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763284#M241718</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-23T16:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763294#M241720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, I have added a code for the dataset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 17:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763294#M241720</guid>
      <dc:creator>newsas007</dc:creator>
      <dc:date>2021-08-23T17:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763304#M241724</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/336862"&gt;@newsas007&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, I have added a code for the dataset.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My example code works with the data from that data set you provided.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 17:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763304#M241724</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-23T17:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763339#M241745</link>
      <description>&lt;P&gt;This turns out to be an educational problem for myself.&amp;nbsp; There is a format for converting numbers to roman numerals, there is no such informat, switching back.&amp;nbsp; Without a way to convert roman numerals to numbers, how will the categories be sorted?&amp;nbsp; I haven't given up, but I did not read that this was mentioned, so now its mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but cty goes to (i) and targ to (iii) always, even if the numeral is wrong, so ok that means it doesn't matter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I think I should know how to read in roman numerals from a text file.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 19:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763339#M241745</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-08-23T19:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763363#M241752</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15329"&gt;@PhilC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This turns out to be an educational problem for myself.&amp;nbsp; There is a format for converting numbers to roman numerals, there is no such informat, switching back.&amp;nbsp; Without a way to convert roman numerals to numbers, how will the categories be sorted?&amp;nbsp; I haven't given up, but I did not read that this was mentioned, so now its mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but cty goes to (i) and targ to (iii) always, even if the numeral is wrong, so ok that means it doesn't matter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I think I should know how to read in roman numerals from a text file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What numbers? Your example data set does not contain any numbers.&lt;/P&gt;
&lt;P&gt;Are you saying that your example data is not actually what your data looks like? If that is case maybe time to use the Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the code I provided not provide the output requested for the given input example data set?&lt;/P&gt;
&lt;P&gt;What sorting, you did not state there was any sorting, your example says that the values were in a desired order if present. So the Roman numeral portion is completely dropped.&lt;/P&gt;
&lt;P&gt;From your original post: "in the order as [(i)cyt, (ii) end therapy, (iii) targ]. Also delete the (i),(ii), and (iii)."&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If something is supposed to be a different order you need to provide input examples and the output.&lt;/P&gt;
&lt;P&gt;If you are worried about the Roman numerals then you have to tell us how big of a Roman numeral is involved and exactly how the numeric value is to be used in the process because this is the first place you mention that has any impact.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 21:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763363#M241752</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-23T21:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763391#M241760</link>
      <description>No, I'm just saying I tried to look and solve this problem, before reading&lt;BR /&gt;your discourse.  I noticed the Roman numerals. At the time I was expecting&lt;BR /&gt;to have to sort the items based on the Roman numerals...&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Aug 2021 00:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763391#M241760</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-08-24T00:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763425#M241781</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15329"&gt;@PhilC&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;No, I'm just saying I tried to look and solve this problem, before reading&lt;BR /&gt;your discourse. I noticed the Roman numerals. At the time I was expecting&lt;BR /&gt;to have to sort the items based on the Roman numerals...&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sorry, I thought that was the OP changing things on us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are describing an application of what my first statistics prof called "Juolas Metatherom" which states "You will seldom misunderstand a problem so as to make it easier." The professor's name was Dr. Juola ...&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 06:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763425#M241781</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-24T06:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763461#M241794</link>
      <description>&lt;P&gt;You can make use of the fact that your categories sort alphabetically:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines dlm=':';
   input ID Categories :$100.;
 datalines;
1:(i)cyt,(ii)end therapy,(iii)targ
2:(ii)cyt,(iii)targ,(ii)end therapy
3:(iii)end therapy,(i)cyt,(iii)targ
4:iii)targ,(i)cyt,(ii)end therapy
5:(iii)end therapy,(i)cyt,(iii)targ
6:iii)targ,(i)cyt,(ii)end therapy
7:(i)cyt,(ii)end therapy,(iii)targ
8:(ii)cyt,(iii)targ,(ii)end therapy
9:(ii)cyt
10:(iii)targ
11:(ii)end therapy
;

data want1;
set have;
do i = 1 to countw(categories,",");
  category = strip(scan(scan(categories,i,","),2,")"));
  output;
end;
keep id category;
run;

proc sort data=want1;
by id category;
run;

data want2;
set want1;
by id;
retain categories;
length categories $100;
if first.id then categories = "";
categories = catx(",",categories,category);
if last.id;
keep id categories;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763461#M241794</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-08-24T08:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763500#M241817</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines dlm=':';
   input ID Categories :$100.;
 datalines;
1:(i)cyt,(ii)end therapy,(iii)targ
2:(ii)cyt,(iii)targ,(ii)end therapy
3:(iii)end therapy,(i)cyt,(iii)targ
4:iii)targ,(i)cyt,(ii)end therapy
5:(iii)end therapy,(i)cyt,(iii)targ
6:iii)targ,(i)cyt,(ii)end therapy
7:(i)cyt,(ii)end therapy,(iii)targ
8:(ii)cyt,(iii)targ,(ii)end therapy
9:(ii)cyt
10:(iii)targ
11:(ii)end therapy
;

data want;
 set have;
 want=prxchange('s/\(.*?\)//',-1,Categories);
 want2=prxchange('s/.*\)//',-1,want);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Aug 2021 13:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763500#M241817</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-08-24T13:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Consistent Categories</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763502#M241818</link>
      <description>&lt;P&gt;before getting distracted by the roman numerals, I intended to make use of the SORT FUNCTION since I don't get to use it very much.&amp;nbsp; Anyway, following my own "Juolas" Metatheory I did not want to assume the categories would be alphabetical.&amp;nbsp; BUT maybe we can, and we can use SORT.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines dlm=':';
   input ID Categories :$100.;
 datalines;
1:(i)cyt,(ii)end therapy,(iii)targ
2:(ii)cyt,(iii)targ,(ii)end therapy
3:(iii)end therapy,(i)cyt,(iii)targ
4:iii)targ,(i)cyt,(ii)end therapy
5:(iii)end therapy,(i)cyt,(iii)targ
6:iii)targ,(i)cyt,(ii)end therapy
7:(i)cyt,(ii)end therapy,(iii)targ
8:(ii)cyt,(iii)targ,(ii)end therapy
9:(ii)cyt
10:(iii)targ
11:(ii)end therapy
;

data want1;
  set have;
  length cat1-cat3 $20;
    array cat[3] $ cat1-cat3;
  do i = 1 to 3;/*assuming 3 categories*/
    cat[i] = strip(scan(scan(categories,i,","),2,")"));
  end;
  _rc=sort(of cat1-cat3);
  category=catx(", ",of cat1-cat3);
  keep id category;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Aug 2021 13:25:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Consistent-Categories/m-p/763502#M241818</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-08-24T13:25:33Z</dc:date>
    </item>
  </channel>
</rss>

