<?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: Using Command Prompt Syntax with Spaces in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645866#M193118</link>
    <description>&lt;P&gt;I knew it was some kind of quoting issue, but I couldn't figure out how many quotes to use, and if they should be single or double.&amp;nbsp; This method did the trick.&amp;nbsp; Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 13:18:08 GMT</pubDate>
    <dc:creator>djbateman</dc:creator>
    <dc:date>2020-05-07T13:18:08Z</dc:date>
    <item>
      <title>Using Command Prompt Syntax with Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645738#M193055</link>
      <description>&lt;P&gt;I am trying to get a list of files in a specified directory, but I have noticed that when using the command prompt syntax that I cannot use directories that contain a space.&amp;nbsp; Does anyone know of a way to get my code to work with spaces?&amp;nbsp; The code should return about 300 files, but I'm getting 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dir=S:\cdm\Programming\445\106\Data Cleaning\MDR\MDR Standard Checks\Part B\AE;
%let ext=xlsx;

filename EXTlist pipe "dir /b /s &amp;amp;dir.\*.&amp;amp;ext.";

data directory;
	infile EXTlist truncover;
	input directory $200.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 21:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645738#M193055</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2020-05-06T21:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Command Prompt Syntax with Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645740#M193056</link>
      <description>&lt;P&gt;My understanding is you need quotes around paths that include spaces. How about this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dir=%str(%')S:\cdm\Programming\445\106\Data Cleaning\MDR\MDR Standard Checks\Part B\AE;
%let ext=xlsx%str(%');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 21:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645740#M193056</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-05-06T21:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using Command Prompt Syntax with Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645744#M193058</link>
      <description>&lt;P&gt;Better in my opinion to leave the macro variable unquoted, and quote when used.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dir=S:\cdm\Programming\445\106\Data Cleaning\MDR\MDR Standard Checks\Part B\AE;
%let ext=xlsx;

filename EXTlist pipe "dir /b /s ""&amp;amp;dir.\*.&amp;amp;ext"" ";

data directory;
	infile EXTlist truncover;
	input directory $200.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 22:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645744#M193058</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-06T22:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Command Prompt Syntax with Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645750#M193061</link>
      <description>&lt;P&gt;Windows filenames can contain ampersands.&amp;nbsp; You will want to be sure SAS does not try to use the &amp;amp; as a resolution directive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Wrap path in %NRSTR for explicit assignment.&amp;nbsp; Use %SUPERQ to resolve the symbol only.&lt;/P&gt;
&lt;PRE&gt;%let path = %nrstr(c:\temp\tom&amp;amp;jerry videos);

filename dir pipe "dir /b /s ""%superq(path)""";

data _null_;
  infile dir;
  input;
  put _infile_;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 May 2020 23:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645750#M193061</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-06T23:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Command Prompt Syntax with Spaces</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645866#M193118</link>
      <description>&lt;P&gt;I knew it was some kind of quoting issue, but I couldn't figure out how many quotes to use, and if they should be single or double.&amp;nbsp; This method did the trick.&amp;nbsp; Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 13:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Command-Prompt-Syntax-with-Spaces/m-p/645866#M193118</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2020-05-07T13:18:08Z</dc:date>
    </item>
  </channel>
</rss>

