<?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: How to recover from a bad macro execution in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125346#M25598</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there's anything wrong with your macro (if you use %str).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataset, however has single quotes within double-quotes. Rewrite as the following and you should be ok, putting two single quotes together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length weding $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Li and Hong''s weding";&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Hong and Hong''s weding"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Hong''s weding";&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call symput('vfromdata',trim(weding));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2012 16:17:20 GMT</pubDate>
    <dc:creator>JasonDiVirgilio</dc:creator>
    <dc:date>2012-05-24T16:17:20Z</dc:date>
    <item>
      <title>How to recover from a bad macro execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125345#M25597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %local test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let test=%bquote(proc print;run;);&amp;nbsp;&amp;nbsp; %*wrong,should use %str instead%*;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put &amp;amp;test;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above macro is wrong, so,after execution, the following DATA doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length weding $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Li and Hong's weding";&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Hong and Hong's weding"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Hong's weding";&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call symput('vfromdata',trim(weding));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but even I follow the macro trouble shooting:&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001302436.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001302436.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;submit the:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; *'; *"; *); */; %mend; run;&lt;/P&gt;&lt;P&gt;and correct the macro %test above (use %str instead). then the macro works fine, but the Data step above still doesn't work。I have to restart SAS, then the data Step works fine again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any way to avoid restarting SAS to make the Data step work after submit the wrong macro above?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 03:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125345#M25597</guid>
      <dc:creator>dreamcatcher</dc:creator>
      <dc:date>2012-05-24T03:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to recover from a bad macro execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125346#M25598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there's anything wrong with your macro (if you use %str).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataset, however has single quotes within double-quotes. Rewrite as the following and you should be ok, putting two single quotes together:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length weding $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Li and Hong''s weding";&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Hong and Hong''s weding"; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weding="Hong''s weding";&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call symput('vfromdata',trim(weding));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 16:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125346#M25598</guid>
      <dc:creator>JasonDiVirgilio</dc:creator>
      <dc:date>2012-05-24T16:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to recover from a bad macro execution</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125347#M25599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if that doesn't work, there was a SAS-L discussion talking about 'enhanced magic strings':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind9810b&amp;amp;L=sas-l&amp;amp;P=17321" title="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind9810b&amp;amp;L=sas-l&amp;amp;P=17321"&gt;http://www.listserv.uga.edu/cgi-bin/wa?A2=ind9810b&amp;amp;L=sas-l&amp;amp;P=17321&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 16:30:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recover-from-a-bad-macro-execution/m-p/125347#M25599</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-05-24T16:30:59Z</dc:date>
    </item>
  </channel>
</rss>

