<?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: Quoted string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406780#M99093</link>
    <description>&lt;P&gt;I will try&amp;nbsp;what you said.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;I will try tomorrow when I have access to the SAS,&lt;BR /&gt; &lt;BR /&gt;This is my typical code.&lt;BR /&gt; &lt;BR /&gt;data _null_;&lt;BR /&gt;
   x= 'SQLCMD -S serever -U user -P passwd -Q "Execute xyz.dbo.abc 111, '2017-10-10'"';&lt;BR /&gt;&lt;BR /&gt;call symput('X', X);&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;filename abc pipe &amp;amp;x.; &lt;BR /&gt;&lt;BR /&gt;At this stage when I am creating file reference single quotes are causing it to fail. SQL server is very particular about where to use single and double quotes.&lt;BR /&gt;&lt;BR /&gt;Idea is to execute SQL Server procs via SQLCMD utility and capture output. I know I can use SQL pass through but it is not executing procs correctly in some cases and I am in touch with SAS support.  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2017 00:49:10 GMT</pubDate>
    <dc:creator>NitinC</dc:creator>
    <dc:date>2017-10-24T00:49:10Z</dc:date>
    <item>
      <title>Quoted string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406751#M99080</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to pass this&amp;nbsp;command to SQL server but single quotes within single quotes are causing issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'SQLCMD -S serever -U user -P passwd -Q "Execute xyz.dbo.abc 111, '2017-10-10'"'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SQLCMD -S serever -U user -P passwd -Q &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Execute xyz.dbo.abc 111, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2017-10-10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 21:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406751#M99080</guid>
      <dc:creator>NitinC</dc:creator>
      <dc:date>2017-10-23T21:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Quoted string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406768#M99086</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40527"&gt;@NitinC&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to pass this&amp;nbsp;command to SQL server but single quotes within single quotes are causing issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'SQLCMD -S serever -U user -P passwd -Q "Execute xyz.dbo.abc 111, '2017-10-10'"'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;SQLCMD -S serever -U user -P passwd -Q &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Execute xyz.dbo.abc 111, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2017-10-10&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What issue? If SAS is throwing an error you might 1) show the error and 2)&amp;nbsp;try replacing one single quote with two single quotes (NOT a double quote) to pass.&lt;/P&gt;
&lt;PRE&gt;data junk;
   x=' This is an example of using SAS''s double single quote to resolve to one quote in data.';
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not promising anything but&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 23:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406768#M99086</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-23T23:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Quoted string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406780#M99093</link>
      <description>&lt;P&gt;I will try&amp;nbsp;what you said.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;I will try tomorrow when I have access to the SAS,&lt;BR /&gt; &lt;BR /&gt;This is my typical code.&lt;BR /&gt; &lt;BR /&gt;data _null_;&lt;BR /&gt;
   x= 'SQLCMD -S serever -U user -P passwd -Q "Execute xyz.dbo.abc 111, '2017-10-10'"';&lt;BR /&gt;&lt;BR /&gt;call symput('X', X);&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;filename abc pipe &amp;amp;x.; &lt;BR /&gt;&lt;BR /&gt;At this stage when I am creating file reference single quotes are causing it to fail. SQL server is very particular about where to use single and double quotes.&lt;BR /&gt;&lt;BR /&gt;Idea is to execute SQL Server procs via SQLCMD utility and capture output. I know I can use SQL pass through but it is not executing procs correctly in some cases and I am in touch with SAS support.  &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 00:49:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406780#M99093</guid>
      <dc:creator>NitinC</dc:creator>
      <dc:date>2017-10-24T00:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Quoted string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406934#M99142</link>
      <description>&lt;PRE&gt;
Try this one :

filename abc pipe %sysfunc(quote(SQLCMD -S serever -U user -P passwd -Q "Execute xyz.dbo.abc 111, '2017-10-10'"))  ;



&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Oct 2017 13:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/406934#M99142</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-10-24T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Quoted string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/407083#M99169</link>
      <description>&lt;P&gt;Sure, I will try this also.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 21:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quoted-string/m-p/407083#M99169</guid>
      <dc:creator>NitinC</dc:creator>
      <dc:date>2017-10-24T21:15:06Z</dc:date>
    </item>
  </channel>
</rss>

