<?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 Masking ;* in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839730#M332001</link>
    <description>&lt;P&gt;Dear community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working on a macro to copy a directory along with all of its content (in SAS EG on a server if relevant) and the issue is that some directories/files have very weird names. Particularly, one of them is named something like "text;text;;*';*" (without double quotes). So to process it correctly I've tried to use %str() function like this:&lt;/P&gt;
&lt;P&gt;%let dir_name=%str(text;text;;*';*);&lt;/P&gt;
&lt;P&gt;but the last 3 symbols (after the second *) are identified as a comment. I don't get any error but later I can't run any code due to unmatched quotes. Which is another issue because I can't fix it (I tried running the following but it doesn't help:&lt;/P&gt;
&lt;P&gt;; *'; *"; );&lt;/P&gt;
&lt;P&gt;Returning to the original problem I've found the following workaround:&lt;/P&gt;
&lt;P&gt;%let dir_name=%str("text;text;;*';*");&lt;/P&gt;
&lt;P&gt;But it is possible that one of the folders/files will contain a double quote resulting in unmatched quotes again. Any suggestions?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 17:25:19 GMT</pubDate>
    <dc:creator>DariaKarpova318</dc:creator>
    <dc:date>2022-10-20T17:25:19Z</dc:date>
    <item>
      <title>Masking ;*</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839730#M332001</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working on a macro to copy a directory along with all of its content (in SAS EG on a server if relevant) and the issue is that some directories/files have very weird names. Particularly, one of them is named something like "text;text;;*';*" (without double quotes). So to process it correctly I've tried to use %str() function like this:&lt;/P&gt;
&lt;P&gt;%let dir_name=%str(text;text;;*';*);&lt;/P&gt;
&lt;P&gt;but the last 3 symbols (after the second *) are identified as a comment. I don't get any error but later I can't run any code due to unmatched quotes. Which is another issue because I can't fix it (I tried running the following but it doesn't help:&lt;/P&gt;
&lt;P&gt;; *'; *"; );&lt;/P&gt;
&lt;P&gt;Returning to the original problem I've found the following workaround:&lt;/P&gt;
&lt;P&gt;%let dir_name=%str("text;text;;*';*");&lt;/P&gt;
&lt;P&gt;But it is possible that one of the folders/files will contain a double quote resulting in unmatched quotes again. Any suggestions?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 17:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839730#M332001</guid>
      <dc:creator>DariaKarpova318</dc:creator>
      <dc:date>2022-10-20T17:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Masking ;*</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839732#M332003</link>
      <description>&lt;P&gt;You need to show what particular statements are causing you trouble.&lt;/P&gt;
&lt;P&gt;But why are you trying to do this with macro code?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having * and ; in the value of actual character variable will not cause any trouble.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just have the macro generate actual SAS code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to pass a string to a macro in as in input parameter then just include the quotes around the values so that the macro processor will ignore them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mymacro(filename='strange*;name');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then the SAS code you just use the value of the macro variable anywhere it could use a string literal.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  rc=fdelete( &amp;amp;filename );
  put rc=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 17:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839732#M332003</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-20T17:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Masking ;*</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839734#M332005</link>
      <description>Sometimes I need a different macro quoting function depending on the characters that are in the value. E.g., %SUPERQ() is an example of a macro quoting function that can mask more symbols than the other macro quoting functions.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/mcrolref/1.0/p0ldeqll9sabzcn1jxnvid754b3t.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/mcrolref/1.0/p0ldeqll9sabzcn1jxnvid754b3t.htm&lt;/A&gt;</description>
      <pubDate>Thu, 20 Oct 2022 17:38:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839734#M332005</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2022-10-20T17:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Masking ;*</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839743#M332009</link>
      <description>&lt;P&gt;UPD: The issue wasn't the ";*" part but the single quote which wasn't masked by %. Now with additional % before the quote it works fine. Thanks everyone and sorry for the silly question. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 18:41:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839743#M332009</guid>
      <dc:creator>DariaKarpova318</dc:creator>
      <dc:date>2022-10-20T18:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Masking ;*</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839760#M332010</link>
      <description>Also as a better alternative to masking every quote I've used %nrbquote (also %bquote) which don't require %.</description>
      <pubDate>Thu, 20 Oct 2022 19:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Masking/m-p/839760#M332010</guid>
      <dc:creator>DariaKarpova318</dc:creator>
      <dc:date>2022-10-20T19:03:30Z</dc:date>
    </item>
  </channel>
</rss>

