<?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: Filename having special character. How to pass macro parameter. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744185#M233108</link>
    <description>However, I am notable to delete the file using Macro code.</description>
    <pubDate>Thu, 27 May 2021 15:07:30 GMT</pubDate>
    <dc:creator>SahooP</dc:creator>
    <dc:date>2021-05-27T15:07:30Z</dc:date>
    <item>
      <title>Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744157#M233088</link>
      <description>&lt;P&gt;Below code trying to resolve. However file is not reading.&lt;/P&gt;&lt;P&gt;%check (&amp;amp;date._3904_TOT_VOL_8TH_POS_OF_DCN_1_OR_GREATER_&amp;amp;_CURR_DCN-OB.csv);&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744157#M233088</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-05-27T14:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744163#M233093</link>
      <description>&lt;P&gt;What is the exact name of the file involved &lt;STRONG&gt;without &lt;/STRONG&gt;macro variables?&lt;/P&gt;
&lt;P&gt;What is the current value of &amp;amp;date?&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744163#M233093</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-27T14:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744165#M233094</link>
      <description>20210524</description>
      <pubDate>Thu, 27 May 2021 14:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744165#M233094</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-05-27T14:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744168#M233095</link>
      <description>&lt;P&gt;So it looks like the first &amp;amp; you want the macro processor to see and the second one you don't.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using %STR().&lt;/P&gt;
&lt;PRE&gt;627   %let date=20210527;
628   %put &amp;amp;date._3904_TOT_VOL_8TH_POS_OF_DCN_1_OR_GREATER_%str(&amp;amp;)_CURR_DCN-OB.csv ;
20210527_3904_TOT_VOL_8TH_POS_OF_DCN_1_OR_GREATER_&amp;amp;_CURR_DCN-OB.csv

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744168#M233095</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-27T14:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744175#M233100</link>
      <description>options symbolgen mprint;&lt;BR /&gt;%macro check(file);&lt;BR /&gt;X "rm /path/users/&amp;amp;file.";&lt;BR /&gt;%mend check;&lt;BR /&gt;&lt;BR /&gt;/*%check(file = 20210524_3904_TOT_RECS_MSTR_DS6_NEW_ADD-CHG_REC-OLD_SPH0_REC.csv); */&lt;BR /&gt;%check (20210524_3904_TOT_VOL_8TH_POS_OF_DCN_1_OR_GREATER_%nrstr(&amp;amp;)_CURR_DCN-OB.csv);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am not able to resolve.</description>
      <pubDate>Thu, 27 May 2021 14:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744175#M233100</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-05-27T14:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744182#M233105</link>
      <description>&lt;P&gt;Use %STR() NOT %NRSTR().&lt;/P&gt;
&lt;P&gt;Using %NRSTR() means the quoting is removed.&amp;nbsp; That will cause the X command the macro generates to try to find the macro variable&amp;nbsp;&lt;SPAN&gt;&amp;amp;_CURR_DCN.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744182#M233105</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-27T14:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744184#M233107</link>
      <description>33 /*%check(file = 20210524_3904_TOT_RECS_MSTR_DS6_NEW_ADD-CHG_REC-OLD_SPH0_REC.csv); */&lt;BR /&gt;34 %check (20210524_3904_TOT_VOL_8TH_POS_OF_DCN_1_OR_GREATER_%str(&amp;amp;)_CURR_DCN-OB.csv);&lt;BR /&gt;MLOGIC(CHECK): Beginning execution.&lt;BR /&gt;MLOGIC(CHECK): Parameter FILE has value 20210524_3904_TOT_VOL_8TH_POS_OF_DCN_1_OR_GREATER_&amp;#1;&amp;amp;&amp;#2;_CURR_DCN-OB.csv&lt;BR /&gt;MLOGIC(CHECK): Ending execution.</description>
      <pubDate>Thu, 27 May 2021 15:03:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744184#M233107</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-05-27T15:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744185#M233108</link>
      <description>However, I am notable to delete the file using Macro code.</description>
      <pubDate>Thu, 27 May 2021 15:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744185#M233108</guid>
      <dc:creator>SahooP</dc:creator>
      <dc:date>2021-05-27T15:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744187#M233110</link>
      <description>&lt;P&gt;Does the file exist where you think it is?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %sysfunc(fileexist(/path/users/&amp;amp;file.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does your implementation of SAS allow you to use operating system commands?&amp;nbsp; If not use the FDELETE() function instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To capture messages from operating system command I like to use PIPE in a data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_
  infile "rm /path/users/&amp;amp;file." pipe;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That way the data step can even read in the messages the command writes and then perhaps make decisions about what to do next based on what messages come back.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 15:15:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744187#M233110</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-27T15:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filename having special character. How to pass macro parameter.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744191#M233113</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322229"&gt;@SahooP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;However, I am notable to delete the file using Macro code.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So now you have to share the code of the macro to show how your are attempting to delete the file and maybe should show the log of your attempt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some common issues: you show a file name but do you attempt to delete that file from the correct directory (or folder or file path)?&lt;/P&gt;
&lt;P&gt;Does the machine executing SAS have access to the folder and file? If you are working with a server version of SAS then that compute probably cannot "see" your local hard drive. And if it does see the file do you&amp;nbsp; have permissions to delete files in that location (this is an operating system issue).&lt;/P&gt;
&lt;P&gt;If using a server version of SAS the Admin may restrict you from using certain commands, which is why we should see your code and log from attempting to run the code. This means you should set the OPTION MPRINT; before running the macro to display more details in the log.&lt;/P&gt;
&lt;P&gt;The operating system you are using may be case sensitive to file names and the value of the macro parameter does not match the case of the name the operating system recognizes.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 15:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filename-having-special-character-How-to-pass-macro-parameter/m-p/744191#M233113</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-27T15:27:34Z</dc:date>
    </item>
  </channel>
</rss>

