<?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: Insert more than one space into character variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405222#M98554</link>
    <description>Thank you!</description>
    <pubDate>Wed, 18 Oct 2017 14:21:06 GMT</pubDate>
    <dc:creator>DmytroYermak</dc:creator>
    <dc:date>2017-10-18T14:21:06Z</dc:date>
    <item>
      <title>Insert more than one space into character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405180#M98536</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have string value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV align="left"&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Cohort&amp;nbsp;33 /&amp;nbsp;0.1 mg/kg&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and have to add 3 more empty spaces between slash and 6, like this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Cohort&amp;nbsp;39 /&amp;nbsp; &amp;nbsp;0.2&amp;nbsp;mg/kg&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best solution for the case? Transword and simple concatination are not working.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 05 Mar 2018 18:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405180#M98536</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2018-03-05T18:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Insert more than one space into character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405191#M98539</link>
      <description>&lt;P&gt;Straight forward:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
length string $30;
string = 'Cohort 9 / 7 mg/kg';
string = substr(string,1,indexc(string,'/')+1) !! '   ' !! substr(string,indexc(string,'/')+2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 12:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405191#M98539</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-10-18T12:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Insert more than one space into character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405194#M98540</link>
      <description>Thank you for the quick reply!</description>
      <pubDate>Wed, 18 Oct 2017 12:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405194#M98540</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-10-18T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert more than one space into character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405195#M98541</link>
      <description>&lt;P&gt;The name of the function is tranwrd not transword.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;string2=tranwrd(string,"/ ","/&amp;nbsp;&amp;nbsp; "); /*works*/&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 12:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405195#M98541</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-10-18T12:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Insert more than one space into character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405222#M98554</link>
      <description>Thank you!</description>
      <pubDate>Wed, 18 Oct 2017 14:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405222#M98554</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-10-18T14:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Insert more than one space into character variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405229#M98557</link>
      <description>&lt;P&gt;Remember if you are attempting to do this with the source variable as the target variable, insert in place as it were, the length of the variable better be long enough to accept the additional characters or you may get truncation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this slight modification of the solution to demonstrate:&lt;/P&gt;
&lt;PRE&gt;data test;
length string $19;
string = 'Cohort 9 / 7 mg/kg';
string = substr(string,1,indexc(string,'/')+1) !! '   ' !! substr(string,indexc(string,'/')+2);
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Oct 2017 14:31:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-more-than-one-space-into-character-variable/m-p/405229#M98557</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-18T14:31:02Z</dc:date>
    </item>
  </channel>
</rss>

