<?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: Add a space after a number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812954#M320773</link>
    <description>&lt;P&gt;Won't work with values like "111green222", but only &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt; knows whether values with multiple numbers exist.&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2022 13:22:25 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-05-12T13:22:25Z</dc:date>
    <item>
      <title>Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812920#M320753</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought this question would be easy but I can't seem to find the answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Say I have data like below:&lt;/P&gt;
&lt;P&gt;4red&lt;/P&gt;
&lt;P&gt;56blue&lt;/P&gt;
&lt;P&gt;118white&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20022orange&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I would like to add a space after the numeric portion so my data looks likes this:&lt;/P&gt;
&lt;P&gt;4 red&lt;/P&gt;
&lt;P&gt;56 blue&lt;/P&gt;
&lt;P&gt;118 white&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20022 orange&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How could I achieve this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 11:49:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812920#M320753</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2022-05-12T11:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812922#M320755</link>
      <description>&lt;P&gt;If the numbers are always integers (are they?) then you can use the NOTDIGIT function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    length newtext $ 24;
    where=notdigit(text);
    newtext=substr(text,1,where-1)||' '||substr(text,where);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 May 2022 12:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812922#M320755</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-12T12:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812928#M320758</link>
      <description>&lt;P&gt;Unfortunately, the whole string is character.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 12:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812928#M320758</guid>
      <dc:creator>luvscandy27</dc:creator>
      <dc:date>2022-05-12T12:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812930#M320760</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Unfortunately, the whole string is character.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's not what I meant by "integer". In your examples&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4red&lt;/P&gt;
&lt;P&gt;56blue&lt;/P&gt;
&lt;P&gt;118white&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20022orange&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all of the digits turn into integers. There are no non-integers such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;20.333orange&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 12:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812930#M320760</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-12T12:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812950#M320770</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var :$25.;
datalines;
4red
56blue
118white
20022orange
;
run;

data want;
	set have;
	f = catx(" ", compress(var, , 'kd'), compress(var, , 'ka'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If length is an issue, make sure to use a LENGTH statement before the CATX statement.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="maguiremq_0-1652361338122.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71377iED2FD7BDF506AAC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="maguiremq_0-1652361338122.png" alt="maguiremq_0-1652361338122.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 13:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812950#M320770</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2022-05-12T13:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812954#M320773</link>
      <description>&lt;P&gt;Won't work with values like "111green222", but only &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255656"&gt;@luvscandy27&lt;/a&gt; knows whether values with multiple numbers exist.&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 13:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/812954#M320773</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-05-12T13:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add a space after a number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/813117#M320856</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var :$25.;
datalines;
4red
56blue
118white
20022orange
;
run;

data want;
	set have;
	want = prxchange('s/(\d+)/\1 /',1,var);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 May 2022 02:55:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-a-space-after-a-number/m-p/813117#M320856</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-05-13T02:55:02Z</dc:date>
    </item>
  </channel>
</rss>

