<?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 to pass comma in macro parametr in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480431#M124173</link>
    <description>&lt;P&gt;Things to test because they look strange ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the bottom of your posted code, END should be %END.&amp;nbsp; That might just be an oversight in what you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro language doesn't use quotes to identify character strings.&amp;nbsp; Get rid of the double quotes within the first parameter to the INPUTC function.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jul 2018 13:39:50 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-07-23T13:39:50Z</dc:date>
    <item>
      <title>how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480410#M124163</link>
      <description>&lt;P&gt;how I can pass comma in macro parameter?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;....
%do i=1 %to &amp;amp;count; 
%let data =%sysfunc(inputc("&amp;amp;&amp;amp;base64code&amp;amp;i", $base64x32767));

%let DOCFILE = &amp;amp;PATH./Doc.&amp;amp;i..xml;
        FILENAME DOCFILE "&amp;amp;DOCFILE" encoding='wcyrillic' LRECL=32767;
        data _null_;
          
          file DOCFILE LRECL=32767;
          length temp $32767;
          put "&amp;amp;data";

        run;

%end;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have error:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR:Literal contains unmatched quote.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But %superq() have &lt;SPAN class="short_text"&gt;&lt;SPAN&gt;the same mistake.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let data =%superq(%sysfunc(inputc("&amp;amp;&amp;amp;base64code&amp;amp;i", $base64x32767)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN&gt;And %NRBQUOTE() have &amp;nbsp;error:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR 616-185: Character constant truncated to 32767 characters.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I do wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:51:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480410#M124163</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-07-23T13:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480413#M124165</link>
      <description>&lt;P&gt;You have unmatched quote. It may or may not have anything to do with the comma.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But we can't give you any more help until you show us your code.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480413#M124165</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-23T13:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480418#M124166</link>
      <description>&lt;P&gt;Show us your code that creating error to assist further.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480418#M124166</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-07-23T13:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480419#M124167</link>
      <description>add code in post</description>
      <pubDate>Mon, 23 Jul 2018 13:27:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480419#M124167</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-07-23T13:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480421#M124169</link>
      <description>I add code in post</description>
      <pubDate>Mon, 23 Jul 2018 13:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480421#M124169</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-07-23T13:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480431#M124173</link>
      <description>&lt;P&gt;Things to test because they look strange ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the bottom of your posted code, END should be %END.&amp;nbsp; That might just be an oversight in what you posted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro language doesn't use quotes to identify character strings.&amp;nbsp; Get rid of the double quotes within the first parameter to the INPUTC function.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480431#M124173</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-23T13:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480434#M124174</link>
      <description>&lt;P&gt;There is a fair bit which looks dubious in this code.&amp;nbsp; Line 2 for instance, it is bad coding to use SAS reserved keywords as variable names, so data is a reserved keyword.&amp;nbsp; nExT uP is COdiNG like that.&amp;nbsp; Use consistent lower case and consistent indetation to make code readable.&lt;/P&gt;
&lt;P&gt;Now for your issue, can you provide some simple test data in the form of a datastep, so that we have something to work with.&amp;nbsp; From what i can tell you want to create &amp;amp;count. number of xml files, so it may well be simpler to do:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  do i=1 to &amp;amp;count.;
    call execute(cat('data _null_;  
                        file docfile "&amp;amp;docfile." encoding="wcyrillic" lrecl=32767;
                        put "',inputc(...,$base65x32767),'";
                      run;'));
  end;
run;&lt;/PRE&gt;
&lt;P&gt;However this opens several more questions just typing that in.&amp;nbsp; Why are you creating XML files - given by the filetype - yet the output you create is not XML?&amp;nbsp; What is &amp;amp;&amp;amp;base64code&amp;amp;i?&amp;nbsp; Why is it such a complicated inputc and encoding, does normal utf8 or 16 not suffice?&amp;nbsp; Why the maximum line length?&amp;nbsp; XML can handle end of line characters and indents and such like just fine, so write a nice readable XML file one record at a time by hand or use a dataset and the XML engine to write it out?&amp;nbsp; Sounds a bit like your creating all the XML into one big macro variable which is not a good idea.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 13:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480434#M124174</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-07-23T13:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480436#M124176</link>
      <description>Yes, it's oversight in what I posted.&lt;BR /&gt;I can't use to INPUTC function. Because text &amp;amp;base64code&amp;amp;i - encode text, and doesn't have double quotes</description>
      <pubDate>Mon, 23 Jul 2018 13:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480436#M124176</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-07-23T13:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480450#M124179</link>
      <description>&lt;P&gt;I'm not sure what it is that you are saying you can't do.&amp;nbsp; The quotes should come out.&amp;nbsp; Here's a sample program to demonstrate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue $test 'abc' = 'xyz';
run;

%let before=abc;

%let after = %sysfunc(inputc(&amp;amp;before, $test.));

%put _user_;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 14:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480450#M124179</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-23T14:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to pass comma in macro parametr</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480483#M124192</link>
      <description>&lt;P&gt;Your posted code has neither commas nor macro parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But to answer you question.&lt;/P&gt;
&lt;P&gt;1) Don't.&amp;nbsp; Why would you want to pass in commas in the value of a macro parameter?&amp;nbsp; If you need to pass in a list use a space or some other character as the delimiter in the list.&lt;/P&gt;
&lt;P&gt;2) If you must you need to "protect' the comma in some way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add quotes or parenthesis to the value. Just remember to either remove them (or don't add them) when you use the value.&amp;nbsp;Or as a LAST resort you can add macro quoting around the value (or just the troubling values).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mymacro
(parm1=space delimited list
,parm2=pipe|delimited|list
,parm3='single,quoted,list'
,parm4="double,quoted,list"
,parm5=(parentheses,around,list)
,parm6=%str(macro,quoted,list)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 15:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-pass-comma-in-macro-parametr/m-p/480483#M124192</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-23T15:36:34Z</dc:date>
    </item>
  </channel>
</rss>

