<?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: Making macro variables resolve with filename pipe command, with single and double quotes in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/436825#M108692</link>
    <description>&lt;P&gt;Assuming you have added semicolons ending your %LET statements ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take this part:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'{ "id" : ["&amp;amp;ID"] }'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace it with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%unquote(%str(%'{ "id" : ["&amp;amp;ID"] }%'&amp;nbsp;))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%STR will temporarily remove the impact of the quotes (which have been suppressing resolution of &amp;amp;ID), and then %UNQUOTE will restore those quotes after resolution has taken place.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Feb 2018 19:30:32 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-02-13T19:30:32Z</dc:date>
    <item>
      <title>Making macro variables resolve with filename pipe command, with single and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/436811#M108689</link>
      <description>&lt;P&gt;Piping a cURL command, I can get the macro variable &amp;amp;array to resolve but I need to make the (-d ID) a macro variable and cannot get it to work.&lt;/P&gt;&lt;P&gt;SAS 9.4.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%LET array = 192.160.1.10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;filename curl5 pipe %TSLIT(curl&amp;nbsp; -L --location-trusted -sk https://&amp;amp;array.:4443/object /info?include_bucket_detail=true -d '{ "id" : ["tst-01"] }' -b /apps/ITNSM/ecs/cookie/Kookie_&amp;amp;array -H "Content-Type: application/json" -H "Accept: application/json")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample of what I need to get working.&lt;/P&gt;&lt;P&gt;This does not work:&amp;nbsp; I need to have the &amp;amp;ID resolve the macro variable.&amp;nbsp; I have tried many variation of using %str/%quote/%bquote but I do not have a good understanding of making this successful.&lt;/P&gt;&lt;P&gt;%LET array = 192.160.1.10&lt;/P&gt;&lt;P&gt;%LET ID= tst-01&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename curl5 pipe %TSLIT(curl&amp;nbsp; -L --location-trusted -sk https://&amp;amp;array.:4443/ object /info?include_bucket_detail=true true -d '{ "id" : ["&amp;amp;ID"] }' -b /apps/ITNSM/ecs/cookie/Kookie_&amp;amp;array -H "Content-Type: application/json" -H "Accept: application/json")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the syntax for the working cURL command under Linux:&amp;nbsp; (Cookie collection is missing), The -d with single and double quotes is the requirement that is giving me trouble.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl "https:// 192.160.1.10:4443/object/ object /info?include_bucket_detail=true true" -d '{"id" : ["tst-01"] }'&amp;nbsp; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;-b &amp;nbsp;/cookie/Kookie_192.160.1.10 -k -v&amp;nbsp;&amp;nbsp; \&lt;/P&gt;&lt;P&gt;&amp;nbsp;-H "Content-Type: application/json" \&lt;/P&gt;&lt;P&gt;&amp;nbsp;-H "accept: application/json"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 19:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/436811#M108689</guid>
      <dc:creator>leh25</dc:creator>
      <dc:date>2018-02-13T19:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Making macro variables resolve with filename pipe command, with single and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/436825#M108692</link>
      <description>&lt;P&gt;Assuming you have added semicolons ending your %LET statements ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take this part:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'{ "id" : ["&amp;amp;ID"] }'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace it with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%unquote(%str(%'{ "id" : ["&amp;amp;ID"] }%'&amp;nbsp;))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%STR will temporarily remove the impact of the quotes (which have been suppressing resolution of &amp;amp;ID), and then %UNQUOTE will restore those quotes after resolution has taken place.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 19:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/436825#M108692</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-13T19:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Making macro variables resolve with filename pipe command, with single and double quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/437068#M108790</link>
      <description>&lt;P&gt;Your solution works!...thanks for your help.&amp;nbsp; I think I have a better understanding of how you used the combination of %str and %unquote to get the macro variable to resolve.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 12:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Making-macro-variables-resolve-with-filename-pipe-command-with/m-p/437068#M108790</guid>
      <dc:creator>leh25</dc:creator>
      <dc:date>2018-02-14T12:53:47Z</dc:date>
    </item>
  </channel>
</rss>

