<?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 Quotes in X Statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Quotes-in-X-Statements/m-p/632344#M187471</link>
    <description>&lt;P&gt;I want to use environment variables in X statement. For example,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x'%programfiles%\sashome\sasfoundation\9.4\sas.exe';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is that quotes in X statements are optional. I originally put single quotes around the path as %PROGRAMFILES% contains one space—C:\Program Files. It seems SAS only reads the contents inside the single quotes and requires double quotes due to the space in %PROGRAMFILES%.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x'"%programfiles%\sashome\sasfoundation\9.4\sas.exe"';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But this doesn't work as well. How can I reconcile those quotes with X statements?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 07:35:06 GMT</pubDate>
    <dc:creator>Junyong</dc:creator>
    <dc:date>2020-03-16T07:35:06Z</dc:date>
    <item>
      <title>Quotes in X Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotes-in-X-Statements/m-p/632344#M187471</link>
      <description>&lt;P&gt;I want to use environment variables in X statement. For example,&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x'%programfiles%\sashome\sasfoundation\9.4\sas.exe';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is that quotes in X statements are optional. I originally put single quotes around the path as %PROGRAMFILES% contains one space—C:\Program Files. It seems SAS only reads the contents inside the single quotes and requires double quotes due to the space in %PROGRAMFILES%.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x'"%programfiles%\sashome\sasfoundation\9.4\sas.exe"';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But this doesn't work as well. How can I reconcile those quotes with X statements?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 07:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotes-in-X-Statements/m-p/632344#M187471</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-03-16T07:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Quotes in X Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotes-in-X-Statements/m-p/632359#M187482</link>
      <description>&lt;P&gt;Run these commands with the filename pipe method and see what response(s) you get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe '"%programfiles%\sashome\sasfoundation\9.4\sas.exe" 2&amp;gt;&amp;amp;1';

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The SAS log will contain all responses.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 10:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotes-in-X-Statements/m-p/632359#M187482</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-16T10:22:49Z</dc:date>
    </item>
  </channel>
</rss>

