<?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: Need to replace a space with Comma using %sysfunc in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874883#M345688</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So your expression translates the commas to blanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Worse still, it would interpret words delimited by commas in &lt;FONT face="courier new,courier"&gt;&amp;amp;var&lt;/FONT&gt;, if any, as separate function arguments and hence apply unwanted additional character replacements to the first word&amp;nbsp;only ...&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 10:47:48 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2023-05-10T10:47:48Z</dc:date>
    <item>
      <title>Need to replace a space with Comma using %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874871#M345679</link>
      <description>&lt;P&gt;%let var = name age height;&lt;/P&gt;&lt;P&gt;%let var1 = %sysfunc(translate(&amp;amp;var, %str(), %str(,)));&lt;/P&gt;&lt;P&gt;%put &amp;amp;var1;&lt;/P&gt;&lt;P&gt;This is giving me output as&amp;nbsp;name age height&lt;/P&gt;&lt;P&gt;but I need it as&amp;nbsp;name ,age, height&lt;/P&gt;&lt;P&gt;Please correct where I am going wrong&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874871#M345679</guid>
      <dc:creator>nxmogil</dc:creator>
      <dc:date>2023-05-10T09:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace a space with Comma using %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874874#M345681</link>
      <description>&lt;P&gt;The TRANSLATE function expects the "to" value to come before the "from" value.&amp;nbsp; So your expression translates the commas to blanks.&amp;nbsp; Reverse the second and third parameters:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var1 = %sysfunc(translate(&amp;amp;var, %str(,), %str( )));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Be sure to add a blank in side the %str function.&amp;nbsp; Nulls are different than blanks in macro language.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874874#M345681</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-05-10T09:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace a space with Comma using %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874875#M345682</link>
      <description>&lt;P&gt;Documentation. The second parameter is the TO value, the third is the From&lt;/P&gt;
&lt;PRE&gt;%let var = name age height;

%let var1 = %sysfunc(translate(&amp;amp;var, %str(,), %str( )));

%put &amp;amp;var1;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/441935"&gt;@nxmogil&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;%let var = name age height;&lt;/P&gt;
&lt;P&gt;%let var1 = %sysfunc(translate(&amp;amp;var, %str(), %str(,)));&lt;/P&gt;
&lt;P&gt;%put &amp;amp;var1;&lt;/P&gt;
&lt;P&gt;This is giving me output as&amp;nbsp;name age height&lt;/P&gt;
&lt;P&gt;but I need it as&amp;nbsp;name ,age, height&lt;/P&gt;
&lt;P&gt;Please correct where I am going wrong&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 09:53:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874875#M345682</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-10T09:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace a space with Comma using %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874878#M345684</link>
      <description>Thank you</description>
      <pubDate>Wed, 10 May 2023 10:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874878#M345684</guid>
      <dc:creator>nxmogil</dc:creator>
      <dc:date>2023-05-10T10:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need to replace a space with Comma using %sysfunc</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874883#M345688</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So your expression translates the commas to blanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Worse still, it would interpret words delimited by commas in &lt;FONT face="courier new,courier"&gt;&amp;amp;var&lt;/FONT&gt;, if any, as separate function arguments and hence apply unwanted additional character replacements to the first word&amp;nbsp;only ...&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 10:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-replace-a-space-with-Comma-using-sysfunc/m-p/874883#M345688</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-05-10T10:47:48Z</dc:date>
    </item>
  </channel>
</rss>

