<?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: what's wrong with this piece of code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44232#M11673</link>
    <description>from the replied tips, it apperas that adding % takes care of it.&lt;BR /&gt;
&lt;BR /&gt;
Thank all who replied.</description>
    <pubDate>Tue, 05 Apr 2011 15:58:44 GMT</pubDate>
    <dc:creator>buckeye</dc:creator>
    <dc:date>2011-04-05T15:58:44Z</dc:date>
    <item>
      <title>what's wrong with this piece of code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44229#M11670</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I got error msg after running the following code. Can anyone please help debug. Thanks in advance.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%MACRO MYSQL;&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
  SELECT COUNT(*) INTO :MYCNT FROM MYTABLE;&lt;BR /&gt;
  %LET MYCNT = &amp;amp;MYCNT;&lt;BR /&gt;
DATA _NULL_;&lt;BR /&gt;
IF &amp;amp;MYCNT &amp;gt; 1 THEN %MYPRINT(MYTABLE,'MYTABLE');&lt;BR /&gt;
RUN;&lt;BR /&gt;
%MEND MYSQL;&lt;BR /&gt;
&lt;BR /&gt;
%MACRO MYPRINT(MYDATA,TN);&lt;BR /&gt;
PROC CONTENTS DATA = &amp;amp;MYDATA POSITION;&lt;BR /&gt;
  TITLE 'Contents of ' &amp;amp;TN;&lt;BR /&gt;
RUN;&lt;BR /&gt;
PROC PRINT DATA=&amp;amp;MYDATA (OBS=10) U;&lt;BR /&gt;
RUN;&lt;BR /&gt;
%MEND MYPRINT;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  %MYSQL;&lt;BR /&gt;
&lt;BR /&gt;
RUN;</description>
      <pubDate>Tue, 05 Apr 2011 14:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44229#M11670</guid>
      <dc:creator>buckeye</dc:creator>
      <dc:date>2011-04-05T14:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: what's wrong with this piece of code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44230#M11671</link>
      <description>PROC CONTENTS cannot be called from within DATA _NULL_;&lt;BR /&gt;
&lt;BR /&gt;
Instead of your DATA _NULL_ step, the following should work&lt;BR /&gt;
&lt;BR /&gt;
%IF &amp;amp;MYCNT &amp;gt; 1 %THEN %MYPRINT(MYTABLE,'MYTABLE');</description>
      <pubDate>Tue, 05 Apr 2011 14:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44230#M11671</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2011-04-05T14:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: what's wrong with this piece of code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44231#M11672</link>
      <description>It would be helpful to see the error message as well as the code that came before it in the SAS log.</description>
      <pubDate>Tue, 05 Apr 2011 15:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44231#M11672</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-04-05T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: what's wrong with this piece of code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44232#M11673</link>
      <description>from the replied tips, it apperas that adding % takes care of it.&lt;BR /&gt;
&lt;BR /&gt;
Thank all who replied.</description>
      <pubDate>Tue, 05 Apr 2011 15:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/what-s-wrong-with-this-piece-of-code/m-p/44232#M11673</guid>
      <dc:creator>buckeye</dc:creator>
      <dc:date>2011-04-05T15:58:44Z</dc:date>
    </item>
  </channel>
</rss>

