<?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 unquoting macro var in stored process in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/unquoting-macro-var-in-stored-process/m-p/43652#M8958</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;within testit macro i want macro variables to be resolved and the outfile name to be generated as sasuser05AUG11_Test's &lt;/P&gt;&lt;P&gt;one way to force the resolution is to use %unquote , %unquote works if the oname does not contain the single quote &lt;/P&gt;&lt;P&gt;Any suggestions to make it work with oname having single quote or any other quoted character as well ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro testit(outputlocation, outputname);&lt;/P&gt;&lt;P&gt;%let outfile=&amp;amp;outputlocation/&amp;amp;outputname;&lt;/P&gt;&lt;P&gt;%put &amp;amp;outfile;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%let _metauser=sasuser;&lt;/P&gt;&lt;P&gt;%let oname=%str(&amp;amp;)_metauser.%str(&amp;amp;)SYSDATE._Test%str(%')s;&lt;/P&gt;&lt;P&gt;%put This is how values are passed into the stored process: &amp;amp;oname;&lt;/P&gt;&lt;P&gt;%let oloc=c:\mysas;&lt;/P&gt;&lt;P&gt;%testit(&amp;amp;oloc, &amp;amp;oname);　&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2011 05:50:00 GMT</pubDate>
    <dc:creator>DataShare</dc:creator>
    <dc:date>2011-08-05T05:50:00Z</dc:date>
    <item>
      <title>unquoting macro var in stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unquoting-macro-var-in-stored-process/m-p/43652#M8958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;within testit macro i want macro variables to be resolved and the outfile name to be generated as sasuser05AUG11_Test's &lt;/P&gt;&lt;P&gt;one way to force the resolution is to use %unquote , %unquote works if the oname does not contain the single quote &lt;/P&gt;&lt;P&gt;Any suggestions to make it work with oname having single quote or any other quoted character as well ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro testit(outputlocation, outputname);&lt;/P&gt;&lt;P&gt;%let outfile=&amp;amp;outputlocation/&amp;amp;outputname;&lt;/P&gt;&lt;P&gt;%put &amp;amp;outfile;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%let _metauser=sasuser;&lt;/P&gt;&lt;P&gt;%let oname=%str(&amp;amp;)_metauser.%str(&amp;amp;)SYSDATE._Test%str(%')s;&lt;/P&gt;&lt;P&gt;%put This is how values are passed into the stored process: &amp;amp;oname;&lt;/P&gt;&lt;P&gt;%let oloc=c:\mysas;&lt;/P&gt;&lt;P&gt;%testit(&amp;amp;oloc, &amp;amp;oname);　&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 05:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unquoting-macro-var-in-stored-process/m-p/43652#M8958</guid>
      <dc:creator>DataShare</dc:creator>
      <dc:date>2011-08-05T05:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: unquoting macro var in stored process</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unquoting-macro-var-in-stored-process/m-p/43653#M8959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you coding for full job security?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BQUOTE will quote an unmatched un-escaped single quote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually macro variables in %PUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;testit&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;(outputlocation, outputname);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;outfile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;=&amp;amp;outputlocation/&amp;amp;outputname;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;outfile;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;metauser=sasuser;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;oname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(&amp;amp;)_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;metauser.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(&amp;amp;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;SYSDATE._Test&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(%')&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;s;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;oname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;nrbquote&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;%unquote&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;(&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;oname));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; This is how values are passed into the stored process: &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;superQ&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;oname);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;oloc&lt;/SPAN&gt;=c:\mysas;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;testit&lt;/EM&gt;&lt;/STRONG&gt;(&amp;amp;oloc, &amp;amp;oname);&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: red; font-family: 'MS Gothic'; background-color: white;"&gt;　&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: #000000; font-family: arial,helvetica,sans-serif; background-color: white;"&gt;I would change the date format to YYYYMMDD so the filenames will sort in a more pleasing order.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; oname=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(&amp;amp;)_metauser.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(today(),yymmddn8.)_Test&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;(%')s;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 11:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unquoting-macro-var-in-stored-process/m-p/43653#M8959</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-08-05T11:24:30Z</dc:date>
    </item>
  </channel>
</rss>

