<?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: create a parameter with commas instead of spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482725#M125092</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;One way to go:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x=1801 1802  1803   1804 1805 1806;
%let new2=%sysfunc(prxchange(s/\b\s+\b/%nrbquote(,)/oi,-1,%nrbquote(&amp;amp;x)));
%put &amp;amp;=new2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 Jul 2018 08:19:30 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-07-31T08:19:30Z</dc:date>
    <item>
      <title>create a parameter with commas instead of spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482716#M125087</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Let's say that a user defined a parameter&lt;/P&gt;&lt;P&gt;%let x=1801 1802 1803 1804 1805 1806;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The task is to create another parameter called new2 that get value:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1801,1802,1803,1804,1805,1806&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(As you can see instead of space there should be a comma)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482716#M125087</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2018-07-31T07:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter with commas instead of spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482717#M125088</link>
      <description>&lt;P&gt;Use the translate() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x=1801 1802 1803 1804 1805 1806;
data _null_;
x1 = translate("&amp;amp;x",","," ");
call symputx('x1',x1);
run;
%put x1=&amp;amp;x1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482717#M125088</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-31T07:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter with commas instead of spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482719#M125089</link>
      <description>&lt;P&gt;Why?&amp;nbsp; In() accepts both a comma and space delimited list.&amp;nbsp; And you would want to write whole blocks of macro code to loop over a list as that would be messy and time consuming.&amp;nbsp; Far easier to use by grouping if needed.&amp;nbsp; If commas really are necessary, then just ask the user to add commas?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482719#M125089</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-31T07:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter with commas instead of spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482725#M125092</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;One way to go:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let x=1801 1802  1803   1804 1805 1806;
%let new2=%sysfunc(prxchange(s/\b\s+\b/%nrbquote(,)/oi,-1,%nrbquote(&amp;amp;x)));
%put &amp;amp;=new2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Jul 2018 08:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482725#M125092</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-07-31T08:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: create a parameter with commas instead of spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482730#M125095</link>
      <description>&lt;P&gt;Note that comma-separated lists turn into a major PITA if you have to use them as macro parameters.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 08:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-parameter-with-commas-instead-of-spaces/m-p/482730#M125095</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-07-31T08:52:00Z</dc:date>
    </item>
  </channel>
</rss>

