<?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 how to insert letter in a string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497270#M131745</link>
    <description>&lt;P&gt;data s ;&lt;BR /&gt;name='sas programmer ' ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;how to insert 'H' in name variable see like below?&lt;/P&gt;&lt;P&gt;Note: without using tranwrd function,substr function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;sas proHgrammer&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Thu, 20 Sep 2018 08:12:16 GMT</pubDate>
    <dc:creator>thanikondharish</dc:creator>
    <dc:date>2018-09-20T08:12:16Z</dc:date>
    <item>
      <title>how to insert letter in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497270#M131745</link>
      <description>&lt;P&gt;data s ;&lt;BR /&gt;name='sas programmer ' ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;how to insert 'H' in name variable see like below?&lt;/P&gt;&lt;P&gt;Note: without using tranwrd function,substr function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;sas proHgrammer&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 20 Sep 2018 08:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497270#M131745</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-09-20T08:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert letter in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497275#M131749</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the ultimate goal and why the relevant tools should be forbidden ?&lt;/P&gt;
&lt;P&gt;What criterion does tell us where the letter should be inserted ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This does what you want but I doubt it really answers your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data s ;&lt;BR /&gt;name='sas programmer ' ;&lt;BR /&gt;name2=cats(scan(name,1,'g'),'Hg',scan(name,2,'g'));&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 08:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497275#M131749</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-09-20T08:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to insert letter in a string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497281#M131754</link>
      <description>&lt;P&gt;Why can you not use the functions designed to manipulate strings?&amp;nbsp; To put it another, your not allowed to use the keyboard, now type your messages in - doesn't make any sense right?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, you would have to loop over the array of characters manually, see below code:&lt;/P&gt;
&lt;PRE&gt;data s;
  /* Note you have to assign a length which is greater than the string length + 1 other wise there will be truncation */
  length name new_name $200; 
  name='sas programmer ';
  do i=1 to lengthn(name);
    if char(name,i-1)=" " then new_name=cat(strip(new_name)," ",char(name,i)); 
    else new_name=cats(new_name,char(name,i));
    if i=7 then new_name=cats(new_name,"H");
  end;
run;&lt;/PRE&gt;
&lt;P&gt;You can sees how much of a waste of time that is!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;And please remember to mark all questions with answered when you have your answer.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;And please use the code window - its the {i} above post area - to post code.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 08:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-insert-letter-in-a-string/m-p/497281#M131754</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-20T08:48:09Z</dc:date>
    </item>
  </channel>
</rss>

