<?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: How to split a character variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565526#M158799</link>
    <description>&lt;P&gt;The following could give you a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input have $80. ;
want=prxchange('s/\S+\s*(Ea|Ct|Kg|Gr|Lt|Lb|Ml)\b//i',-1,have);
cards;
Sauce Alfredo #2 4/2 Kg	
Sauce Alfredo 2/3.7 Lt
Assist 1Al1 1/18.9 LT	
Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb
100% Whole Wheat 1/675 Gr	
15X20X1/2 White Cut/Board 6/1 Ea	
16Oz White Plastic Funnel 1/1 Ea	
A&amp;amp;W Diet Root Beer 12/355 Ml	
A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml	
Almond Slivered Blanched (20067261010715) 2/1.50 Kg	
Almond Slivered Blanched 1/3 Kg	
Almond Whole Blanched (20067261010418) 2/1.50 Kg	
Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg
Bacon 16/18 Ct Applewood Smoked 1/5 Kg	
Bacon 16/18 Ct Center Cut 1/5 Kg	
Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 12 Jun 2019 12:14:33 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-06-12T12:14:33Z</dc:date>
    <item>
      <title>How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565381#M158721</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I have a character variable called Description&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;HAVE&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;WANT&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sauce Alfredo #2 4/2 Kg&lt;/TD&gt;&lt;TD&gt;Sauce Alfredo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sauce Alfredo 2/3.7 Lt&lt;/TD&gt;&lt;TD&gt;Sauce Alfredo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assist 1Al1 1/18.9 LT&lt;/TD&gt;&lt;TD&gt;Assist 1Al1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb&lt;/TD&gt;&lt;TD&gt;Assouplissant Solid Navisoft Bp S#Ncf#&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100% Whole Wheat 1/675 Gr&lt;/TD&gt;&lt;TD&gt;100% Whole Wheat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15X20X1/2 White Cut/Board 6/1 Ea&lt;/TD&gt;&lt;TD&gt;15X20X1/2 White Cut/Board&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16Oz White Plastic Funnel 1/1 Ea&lt;/TD&gt;&lt;TD&gt;16Oz White Plastic Funnel&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&amp;amp;W Diet Root Beer 12/355 Ml&lt;/TD&gt;&lt;TD&gt;A&amp;amp;W Diet Root Beer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml&lt;/TD&gt;&lt;TD&gt;A&amp;amp;W Rootbeer Fridge Pack&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Almond Slivered Blanched (20067261010715) 2/1.50 Kg&lt;/TD&gt;&lt;TD&gt;Almond Slivered Blanched (20067261010715)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Almond Slivered Blanched 1/3 Kg&lt;/TD&gt;&lt;TD&gt;Almond Slivered Blanched&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Almond Whole Blanched (20067261010418) 2/1.50 Kg&lt;/TD&gt;&lt;TD&gt;Almond Whole Blanched (20067261010418)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg&lt;/TD&gt;&lt;TD&gt;Bacon 14/16 Ct Center Cut 8.75 In Sliced&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacon 16/18 Ct Applewood Smoked 1/5 Kg&lt;/TD&gt;&lt;TD&gt;Bacon 16/18 Ct Applewood Smoked&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacon 16/18 Ct Center Cut 1/5 Kg&lt;/TD&gt;&lt;TD&gt;Bacon 16/18 Ct Center Cut&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct&lt;/TD&gt;&lt;TD&gt;Bag Garbage 35X50 Heavy Duty Natural&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bag Garbage 35X50 Regular Black 1/100 Ct&lt;/TD&gt;&lt;TD&gt;Bag Garbage 35X50 Regular Black&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bar Granola Fruit &amp;amp; Nut Trail Mix (000065633408811) 8/12/35 Gr&lt;/TD&gt;&lt;TD&gt;Bar Granola Fruit &amp;amp; Nut Trail Mix (000065633408811)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bar Granola Oats N' Honey Crunchy 6/12/46 Gr&lt;/TD&gt;&lt;TD&gt;Bar Granola Oats N' Honey Crunchy&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Set Measure SS 6/1 Ea&lt;/TD&gt;&lt;TD&gt;Spoon Set Measure SS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Soup Celine 18/0 Round 7 - 17.8Cm (502513) 12/1 Ea&lt;/TD&gt;&lt;TD&gt;Spoon Soup Celine 18/0 Round 7 - 17.8Cm (502513)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Soup Ecopro Poly 1/1000 Ea (10057937706427)&lt;/TD&gt;&lt;TD&gt;Spoon Soup Ecopro Poly (10057937706427)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Soup Medium Weight Polypro Dense (00620868514701) 1/1000 Ct&lt;/TD&gt;&lt;TD&gt;Spoon Soup Medium Weight Polypro Dense (00620868514701)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Wooden 18 In W/Long Handle 1/1 Ea&lt;/TD&gt;&lt;TD&gt;Spoon Wooden 18 In W/Long Handle&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Wooden Heavy Duty 16 In - 40.6 Cm 1/1 Ea (575386)&lt;/TD&gt;&lt;TD&gt;Spoon Wooden Heavy Duty 16 In - 40.6 Cm (575386)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spread Apple Raspberry 1/14 Kg&lt;/TD&gt;&lt;TD&gt;Spread Apple Raspberry&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to take the Quantity out for eg (Ea, Ct, Kg, Kg), some of the Ea's are in between the description.&lt;/P&gt;&lt;P&gt;I would appreciate any help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 19:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565381#M158721</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-11T19:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565382#M158722</link>
      <description>Data cleaning. Welcome to the world of fun with functions. &lt;BR /&gt;&lt;BR /&gt;Functions that will be helpful here:&lt;BR /&gt;&lt;BR /&gt;COMPRESS()&lt;BR /&gt;TRANSLATE&lt;BR /&gt;TRANWRD&lt;BR /&gt;SCAN()&lt;BR /&gt;COUNTW()&lt;BR /&gt;FIND/FINDW&lt;BR /&gt;INDEX/INDEXW&lt;BR /&gt;and &lt;BR /&gt;Regular Expressions. &lt;BR /&gt;&lt;BR /&gt;TRANWRD will replace words, translate will replace strings. &lt;BR /&gt;SCAN() will separate words&lt;BR /&gt;COUNTW() will count the number of words&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Jun 2019 20:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565382#M158722</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-11T20:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565384#M158723</link>
      <description>&lt;P&gt;Is it possible to give me an example with some code&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 20:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565384#M158723</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-11T20:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565401#M158732</link>
      <description>&lt;P&gt;If this were my project before spending a lot time with what is going to be messy code I would go to the data source and see if there is a way to provide the information with the&amp;nbsp;units and quantity&amp;nbsp;as a separate field from the product or whatever.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be that whoever supplied this to you actually combined things from multiple fields into a single field thinking that was what was desired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have an inventory data base floating around talk to the users or DB admins and see if there isn't a description separate from the packing units. It is very likely as many times you have "case" as well as "box" or "package" units which are handled in the inventory program to help when someone needs xxx of something.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 20:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565401#M158732</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-11T20:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565526#M158799</link>
      <description>&lt;P&gt;The following could give you a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input have $80. ;
want=prxchange('s/\S+\s*(Ea|Ct|Kg|Gr|Lt|Lb|Ml)\b//i',-1,have);
cards;
Sauce Alfredo #2 4/2 Kg	
Sauce Alfredo 2/3.7 Lt
Assist 1Al1 1/18.9 LT	
Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb
100% Whole Wheat 1/675 Gr	
15X20X1/2 White Cut/Board 6/1 Ea	
16Oz White Plastic Funnel 1/1 Ea	
A&amp;amp;W Diet Root Beer 12/355 Ml	
A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml	
Almond Slivered Blanched (20067261010715) 2/1.50 Kg	
Almond Slivered Blanched 1/3 Kg	
Almond Whole Blanched (20067261010418) 2/1.50 Kg	
Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg
Bacon 16/18 Ct Applewood Smoked 1/5 Kg	
Bacon 16/18 Ct Center Cut 1/5 Kg	
Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2019 12:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565526#M158799</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-12T12:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565536#M158801</link>
      <description>&lt;P&gt;Thank you for your advise, I have reached out to the source.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 12:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565536#M158801</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-12T12:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565537#M158802</link>
      <description>&lt;P&gt;Thank you so much !!! this will help me get started for sure&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 12:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/565537#M158802</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-12T12:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/567967#M159793</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Also is it possible to put the quantity (what was deleted in the prxchange command) into another field?&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;HAVE&lt;/TD&gt;&lt;TD&gt;Quantity&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sauce Alfredo #2 4/2 Kg&lt;/TD&gt;&lt;TD&gt;4/2 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Sauce Alfredo 2/3.7 Lt&lt;/TD&gt;&lt;TD&gt;2/3.7 Lt&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assist 1Al1 1/18.9 LT&lt;/TD&gt;&lt;TD&gt;1/18.9 LT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb&lt;/TD&gt;&lt;TD&gt;2/6Lb&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100% Whole Wheat 1/675 Gr&lt;/TD&gt;&lt;TD&gt;1/675 Gr&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15X20X1/2 White Cut/Board 6/1 Ea&lt;/TD&gt;&lt;TD&gt;6/1 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16Oz White Plastic Funnel 1/1 Ea&lt;/TD&gt;&lt;TD&gt;1/1 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&amp;amp;W Diet Root Beer 12/355 Ml&lt;/TD&gt;&lt;TD&gt;12/355 Ml&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml&lt;/TD&gt;&lt;TD&gt;12/355 Ml&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Almond Slivered Blanched (20067261010715) 2/1.50 Kg&lt;/TD&gt;&lt;TD&gt;2/1.50 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Almond Slivered Blanched 1/3 Kg&lt;/TD&gt;&lt;TD&gt;1/3 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Almond Whole Blanched (20067261010418) 2/1.50 Kg&lt;/TD&gt;&lt;TD&gt;2/1.50 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg&lt;/TD&gt;&lt;TD&gt;1/5 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacon 16/18 Ct Applewood Smoked 1/5 Kg&lt;/TD&gt;&lt;TD&gt;1/5 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bacon 16/18 Ct Center Cut 1/5 Kg&lt;/TD&gt;&lt;TD&gt;1/5 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct&lt;/TD&gt;&lt;TD&gt;1/200 Ct&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bag Garbage 35X50 Regular Black 1/100 Ct&lt;/TD&gt;&lt;TD&gt;1/100 Ct&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bar Granola Fruit &amp;amp; Nut Trail Mix (000065633408811) 8/12/35 Gr&lt;/TD&gt;&lt;TD&gt;8/12/35 Gr&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bar Granola Oats N' Honey Crunchy 6/12/46 Gr&lt;/TD&gt;&lt;TD&gt;6/12/46 Gr&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Set Measure SS 6/1 Ea&lt;/TD&gt;&lt;TD&gt;6/1 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Soup Celine 18/0 Round 7 - 17.8Cm (502513) 12/1 Ea&lt;/TD&gt;&lt;TD&gt;12/1 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Soup Ecopro Poly 1/1000 Ea (10057937706427)&lt;/TD&gt;&lt;TD&gt;1/1000 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Soup Medium Weight Polypro Dense (00620868514701) 1/1000 Ct&lt;/TD&gt;&lt;TD&gt;1/1000 Ct&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Wooden 18 In W/Long Handle 1/1 Ea&lt;/TD&gt;&lt;TD&gt;1/1 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spoon Wooden Heavy Duty 16 In - 40.6 Cm 1/1 Ea (575386)&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;1/1 Ea&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Spread Apple Raspberry 1/14 Kg&lt;/TD&gt;&lt;TD&gt;1/14 Kg&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;thank you for your help&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 15:39:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/567967#M159793</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-21T15:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568119#M159868</link>
      <description>&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Bacon &lt;STRONG&gt;16/18 Ct&lt;/STRONG&gt; Center Cut&lt;STRONG&gt; 1/5 Kg&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;1/5 Kg&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Bag Garbage 35X50 Heavy Duty Natural &lt;STRONG&gt;1/200 Ct&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;1/200 Ct&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why 16/18 Ct in the first obs is not picked up ?&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2019 12:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568119#M159868</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-22T12:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568121#M159869</link>
      <description>&lt;P&gt;The following could give a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards dsd truncover;
input x : $80.;
pid=prxparse('/[\.\/\d]+\s*(Ea|Kg|Ct|Gr|Lt|Lb|Ml)\b/i');
call prxsubstr(pid,x,p,l);
if p then want=substr(x,p,l);
drop pid p l;
cards;
Sauce Alfredo #2 4/2 Kg	 4/2 Kg
Sauce Alfredo 2/3.7 Lt	2/3.7 Lt
Assist 1Al1 1/18.9 LT	1/18.9 LT
Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb	2/6Lb
100% Whole Wheat 1/675 Gr	1/675 Gr
15X20X1/2 White Cut/Board 6/1 Ea	6/1 Ea
16Oz White Plastic Funnel 1/1 Ea	1/1 Ea
A&amp;amp;W Diet Root Beer 12/355 Ml	12/355 Ml
A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml	12/355 Ml
Almond Slivered Blanched (20067261010715) 2/1.50 Kg	2/1.50 Kg
Almond Slivered Blanched 1/3 Kg	1/3 Kg
Almond Whole Blanched (20067261010418) 2/1.50 Kg	2/1.50 Kg
Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg	1/5 Kg
Bacon 16/18 Ct Applewood Smoked 1/5 Kg	1/5 Kg
Bacon 16/18 Ct Center Cut 1/5 Kg	1/5 Kg
Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct	1/200 Ct
Bag Garbage 35X50 Regular Black 1/100 Ct	1/100 Ct
Bar Granola Fruit &amp;amp; Nut Trail Mix (000065633408811) 8/12/35 Gr	8/12/35 Gr
Bar Granola Oats N' Honey Crunchy 6/12/46 Gr	6/12/46 Gr
Spoon Set Measure SS 6/1 Ea	6/1 Ea
Spoon Soup Celine 18/0 Round 7 - 17.8Cm (502513) 12/1 Ea	12/1 Ea
Spoon Soup Ecopro Poly 1/1000 Ea (10057937706427)	1/1000 Ea
Spoon Soup Medium Weight Polypro Dense (00620868514701) 1/1000 Ct	1/1000 Ct
Spoon Wooden 18 In W/Long Handle 1/1 Ea	1/1 Ea
Spoon Wooden Heavy Duty 16 In - 40.6 Cm 1/1 Ea (575386)	 1/1 Ea
Spread Apple Raspberry 1/14 Kg
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jun 2019 12:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568121#M159869</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-22T12:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568185#M159888</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275285"&gt;@Gladis6680&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Since your pattern is rather simple, surely it is possible, even without the sophistication of regexen. All you have to do is find the position of the blank before the &lt;EM&gt;last&lt;/EM&gt; slash:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                                                               
  input have $80. ;                                                       
  cards;                                                                  
Sauce Alfredo #2 4/2 Kg                                                   
Sauce Alfredo 2/3.7 Lt                                                    
Assist 1Al1 1/18.9 LT                                                     
Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb                              
100% Whole Wheat 1/675 Gr                                                 
15X20X1/2 White Cut/Board 6/1 Ea                                          
16Oz White Plastic Funnel 1/1 Ea                                          
A&amp;amp;W Diet Root Beer 12/355 Ml                                              
A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml                                        
Almond Slivered Blanched (20067261010715) 2/1.50 Kg                       
Almond Slivered Blanched 1/3 Kg                                           
Almond Whole Blanched (20067261010418) 2/1.50 Kg                          
Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg                           
Bacon 16/18 Ct Applewood Smoked 1/5 Kg                                    
Bacon 16/18 Ct Center Cut 1/5 Kg                                          
Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct                             
run ;                                                                     
                                                                          
data want ;                                                               
  set have ;                                                              
  _n_ = findc (substr (have, 1, findc (have, "/", -32767)), " ", -32767) ;
  quantity = substr (have, _n_ + 1) ;                                     
  have     = substr (have,  1, _n_) ;                                     
run ;                                                                     
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Note that you &lt;EM&gt;cannot&lt;/EM&gt; swap the order of the assignment statements for QUANTITY and HAVE without breaking the algorithm.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 04:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568185#M159888</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-06-23T04:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568186#M159889</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Because the OP's pattern rule appears to be simpler than you might have thought. It is merely "find the last slash and split on the position of the first blank before it".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 04:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568186#M159889</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-06-23T04:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568210#M159897</link>
      <description>&lt;P&gt;Then SCAN() is more than suffice .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                                                               
  input have $80. ;                                                       
  cards;                                                                  
Sauce Alfredo #2 4/2 Kg                                                   
Sauce Alfredo 2/3.7 Lt                                                    
Assist 1Al1 1/18.9 LT                                                     
Assouplissant Solid Navisoft Bp S#Ncf# 2/6Lb                              
100% Whole Wheat 1/675 Gr                                                 
15X20X1/2 White Cut/Board 6/1 Ea                                          
16Oz White Plastic Funnel 1/1 Ea                                          
A&amp;amp;W Diet Root Beer 12/355 Ml                                              
A&amp;amp;W Rootbeer Fridge Pack 12/355 Ml                                        
Almond Slivered Blanched (20067261010715) 2/1.50 Kg                       
Almond Slivered Blanched 1/3 Kg                                           
Almond Whole Blanched (20067261010418) 2/1.50 Kg                          
Bacon 14/16 Ct Center Cut 8.75 In Sliced 1/5 Kg                           
Bacon 16/18 Ct Applewood Smoked 1/5 Kg                                    
Bacon 16/18 Ct Center Cut 1/5 Kg                                          
Bag Garbage 35X50 Heavy Duty Natural 1/200 Ct
; 
run ;                                                                     
                                                                          
data want ;                                                               
  set have ;    
  want=catx('/',scan(scan(have,-2,'/'),-1,' '),scan(have,-1,'/'));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jun 2019 12:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568210#M159897</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-23T12:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568225#M159901</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;To form the "quantity" part, which you name here WANT, - yes, it does (though I'd rather not leave it at the default length 200). However, it leaves HAVE uncut. Methinks to rid it of the trailing "quantity", determining the split position and making SUBSTR rely on it is still called for. In principle, using TRANWRD to replace the trailing "quantity" with blanks is possible, but it's iffy since the presence of the same substring in HAVE, though unlikely, cannot be ruled out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 17:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568225#M159901</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-06-23T17:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568537#M160057</link>
      <description>&lt;P&gt;Thank you so much !!! I have to do some manual parsing in order to the quantity, but this has definitely helped me!!!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:32:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568537#M160057</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-24T20:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568539#M160059</link>
      <description>&lt;P&gt;Thank you so much !!!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 20:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/568539#M160059</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-24T20:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569771#M160598</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I had another question regarding this. I have slightly modified this by&amp;nbsp; just added the other units of measurement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;want=prxchange('s/\S+\s*(Ea|Ct|Kg|Gr|Lt|Lb|Ml|Ga|Oz|Fl|Ga|Each|L)\b//i',-1,have);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I get the below table, is it possible to make the above code case sensitive, meaning it only takes out 'Ea' and not 'ea'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate your help, Thank you&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;HAVE&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;GETTING&lt;/TD&gt;&lt;TD&gt;WANT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nestea Tea Cool Fridge Pack 12/355 Ml&lt;/TD&gt;&lt;TD&gt;Fridge Pack&lt;/TD&gt;&lt;TD&gt;Nestea Tea Cool Fridge Pack&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tea Traditional Herbal Variety Pack 6/28 Ct&lt;/TD&gt;&lt;TD&gt;Variety Pack&lt;/TD&gt;&lt;TD&gt;Tea Traditional Herbal Variety Pack&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tea Herbal Apple Cranberry 6/28 Ct&lt;/TD&gt;&lt;TD&gt;Apple Cranberry&lt;/TD&gt;&lt;TD&gt;Tea Herbal Apple Cranberry&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nestea Tea Green W/Lemon 12/500 Ml&lt;/TD&gt;&lt;TD&gt;Green W/Lemon&lt;/TD&gt;&lt;TD&gt;Nestea Tea Green W/Lemon&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Crystal Apple Low Calorie (20058336320846) 2/500 Gr&lt;/TD&gt;&lt;TD&gt;Apple Low Calorie (20058336320846)&lt;/TD&gt;&lt;TD&gt;Crystal Apple Low Calorie (20058336320846)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Drink Juice Cocktail Cranberry 12/1 Lt&lt;/TD&gt;&lt;TD&gt;Drink Juice&amp;nbsp; Cranberry&lt;/TD&gt;&lt;TD&gt;Drink Juice Cocktail Cranberry&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Juice Cranberry Cocktail Plastic 24/300 Ml&lt;/TD&gt;&lt;TD&gt;Juice Cranberry&amp;nbsp; Plastic&lt;/TD&gt;&lt;TD&gt;Juice Cranberry Cocktail Plastic&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Juice Cranberry Cocktail Plastic Portion Cup (50058056200368) 96/114 Ml&lt;/TD&gt;&lt;TD&gt;Juice Cranberry&amp;nbsp; Plastic Portion Cup (50058056200368)&lt;/TD&gt;&lt;TD&gt;Juice Cranberry Cocktail Plastic Portion Cup (50058056200368)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Juice Cranberry Cocktail Tetra Slim 12/1 Lt (10056412503629)&lt;/TD&gt;&lt;TD&gt;Juice Cranberry&amp;nbsp; Tetra Slim&amp;nbsp; (10056412503629)&lt;/TD&gt;&lt;TD&gt;Juice Cranberry Cocktail Tetra Slim (10056412503629)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 28 Jun 2019 13:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569771#M160598</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-28T13:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569781#M160601</link>
      <description>&lt;P&gt;Remove ' i ' modification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;prxchange('s/\S+\s*(Ea|Ct|Kg|Gr|Lt|Lb|Ml|Ga|Oz|Fl|Ga|Each|L)\b//&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/FONT&gt;',-1,have);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;-&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;prxchange('s/\S+\s*(Ea|Ct|Kg|Gr|Lt|Lb|Ml|Ga|Oz|Fl|Ga|Each|L)\b//',-1,have);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 13:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569781#M160601</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-06-28T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569810#M160612</link>
      <description>&lt;P&gt;thank you very much, that worked!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 14:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569810#M160612</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-28T14:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569940#M160669</link>
      <description>&lt;P&gt;So sorry to ask so many questions, but I am not so familiar with the prxchange function. Is it possible to also take the information in the brackets with the number. I tried different possibilities, but its not working. Thank you very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;prxchange('s/\S+\s*(Ea|Ct|Kg|Gr|Lt|Lb|Ml|Ga|Oz|Fl|Ga|Each|L)\b//',-1,have);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;HAVE&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;WANT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Crystal Apple Low Calorie (20058336320846) 2/500 Gr&lt;/TD&gt;&lt;TD&gt;Crystal Apple Low Calorie&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Juice Cranberry Cocktail Plastic Portion Cup (50058056200368) 96/114 Ml&lt;/TD&gt;&lt;TD&gt;Juice Cranberry Cocktail Plastic Portion Cup&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Juice Cranberry Cocktail Tetra Slim 12/1 Lt (10056412503629)&lt;/TD&gt;&lt;TD&gt;Juice Cranberry Cocktail Tetra Slim&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 28 Jun 2019 18:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-split-a-character-variable/m-p/569940#M160669</guid>
      <dc:creator>Gladis6680</dc:creator>
      <dc:date>2019-06-28T18:42:50Z</dc:date>
    </item>
  </channel>
</rss>

