<?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 can i replace multiple varibale in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512481#M138048</link>
    <description>&lt;P&gt;I think you made a mistake in your wanted output.&lt;/P&gt;&lt;P&gt;You put &lt;SPAN&gt;abc4efg4&lt;STRONG&gt;h&lt;/STRONG&gt;ij4lmn4pqr4tuv4 when I believe it is&amp;nbsp;abc4efg4ijk4mno4qrs4uvw4. The problem being that h.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.want;
attrib 	a format = $50.
		want format = $50.
;


a ='abcdefghijklmnopqrstuvwx';
array lettersInA[26] $ _TEMPORARY_;


do i = 1 to lengthn(a);
	if mod(i,4) = 0 then lettersInA[i] = "4";
	else lettersInA[i] = substr(a,i,1);
end;

want = cats(of lettersInA[*]);
drop i;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 13 Nov 2018 09:26:32 GMT</pubDate>
    <dc:creator>DanielLangley</dc:creator>
    <dc:date>2018-11-13T09:26:32Z</dc:date>
    <item>
      <title>how can i replace multiple varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512450#M138030</link>
      <description>&lt;P&gt;what function can i use to replace the variable with 4&amp;nbsp; in the place of 4 or multiples of 4 ??&lt;/P&gt;&lt;P&gt;the input&amp;nbsp; is&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data one ;&lt;BR /&gt;a='abcdefghijklmnopqrstuvwx';&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the output i want is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;abc4efg4hij4lmn4pqr4tuv4&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 05:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512450#M138030</guid>
      <dc:creator>Aayushi_17</dc:creator>
      <dc:date>2018-11-13T05:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: how can i replace multiple varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512461#M138036</link>
      <description>Can't test the code now, try something like:&lt;BR /&gt;&lt;BR /&gt;data work.want;&lt;BR /&gt;a ='abcdefghijklmnopqrstuvwx';&lt;BR /&gt;&lt;BR /&gt;do i = 1 to lengthen(a);&lt;BR /&gt;if int(i/4) = 0 then do;&lt;BR /&gt;substr(a, i, 1) = '4';&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;</description>
      <pubDate>Tue, 13 Nov 2018 06:27:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512461#M138036</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2018-11-13T06:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: how can i replace multiple varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512481#M138048</link>
      <description>&lt;P&gt;I think you made a mistake in your wanted output.&lt;/P&gt;&lt;P&gt;You put &lt;SPAN&gt;abc4efg4&lt;STRONG&gt;h&lt;/STRONG&gt;ij4lmn4pqr4tuv4 when I believe it is&amp;nbsp;abc4efg4ijk4mno4qrs4uvw4. The problem being that h.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.want;
attrib 	a format = $50.
		want format = $50.
;


a ='abcdefghijklmnopqrstuvwx';
array lettersInA[26] $ _TEMPORARY_;


do i = 1 to lengthn(a);
	if mod(i,4) = 0 then lettersInA[i] = "4";
	else lettersInA[i] = substr(a,i,1);
end;

want = cats(of lettersInA[*]);
drop i;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Nov 2018 09:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512481#M138048</guid>
      <dc:creator>DanielLangley</dc:creator>
      <dc:date>2018-11-13T09:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: how can i replace multiple varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512519#M138060</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
a ='abcdefghijklmnopqrstuvwx';
put a=;
do i = 4 to length(a) by 4;
substr(a, i, 1) = '4';
end;
put a=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512519#M138060</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-11-13T12:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: how can i replace multiple varibale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512837#M138151</link>
      <description>&lt;P&gt;thank you so much this worked&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 05:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-i-replace-multiple-varibale/m-p/512837#M138151</guid>
      <dc:creator>Aayushi_17</dc:creator>
      <dc:date>2018-11-14T05:00:55Z</dc:date>
    </item>
  </channel>
</rss>

