<?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: datastep inside a macro  type question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40060#M10362</link>
    <description>&amp;gt; Try removing % sign in if-else-then and do-end loop&lt;BR /&gt;
&amp;gt; statments.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;  ~ Sukanya E&lt;BR /&gt;
&lt;BR /&gt;
It worked perfectly  and Thanks infinitely &lt;BR /&gt;
I guess the issue i had initially was execution time versus interpretation time&lt;BR /&gt;
wasn't ?&lt;BR /&gt;
What do you think i should know about in  order to avoid this kind of problems ?&lt;BR /&gt;
thanks in advance</description>
    <pubDate>Tue, 02 Jun 2009 19:03:04 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-06-02T19:03:04Z</dc:date>
    <item>
      <title>datastep inside a macro  type question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40058#M10360</link>
      <description>what is wrong with my following code? your help is really appreciated&lt;BR /&gt;
%let mcy=9;&lt;BR /&gt;
%macro read;&lt;BR /&gt;
filename in " path\fictional_data.txt";&lt;BR /&gt;
data read;&lt;BR /&gt;
infile in end=eof lrecl=10;&lt;BR /&gt;
input @1   i&amp;amp;mcy.IDO   $CHAR2.&lt;BR /&gt;
      @3   i&amp;amp;mcy.IPSS  $CHAR5.&lt;BR /&gt;
	  @8   i&amp;amp;mcy.IPHP  $CHAR3.	&lt;BR /&gt;
       ;&lt;BR /&gt;
%if (i&amp;amp;mcy.IDO ne 'AL'  and i&amp;amp;mcy.IDO ne 'AK' ) and (i&amp;amp;mcy.IPSS ne ' ')&lt;BR /&gt;
and (i&amp;amp;mcy.IPHP ne " " and i&amp;amp;mcy.IPHP ne "000" ) %then i&amp;amp;mcy.IDO="FR";&lt;BR /&gt;
%else &lt;BR /&gt;
	%do ;&lt;BR /&gt;
		i&amp;amp;mcy.IDO="XX";&lt;BR /&gt;
	%end;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend read;&lt;BR /&gt;
%read&lt;BR /&gt;
&lt;BR /&gt;
this is the log error i am getting  &lt;BR /&gt;
&lt;BR /&gt;
NOTE: Line generated by the invoked macro "READ".&lt;BR /&gt;
5     run;&lt;BR /&gt;
      ---&lt;BR /&gt;
      22&lt;BR /&gt;
MPRINT(READ):   i9IDO="FR" run&lt;BR /&gt;
MLOGIC(READ):  Ending execution.&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: !,&lt;BR /&gt;
              !!, &amp;amp;, *, **, +, -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=,&lt;BR /&gt;
              AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG,&lt;BR /&gt;
              NL, NOTIN, OR, ^=, |, ||, ~=.&lt;BR /&gt;
&lt;BR /&gt;
************any help is appreciated!!!!!!!!!!!!

Message was edited by: statmn</description>
      <pubDate>Tue, 02 Jun 2009 16:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40058#M10360</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-02T16:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: datastep inside a macro  type question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40059#M10361</link>
      <description>Try removing % sign in if-else-then and do-end loop statments.&lt;BR /&gt;
&lt;BR /&gt;
 ~ Sukanya E</description>
      <pubDate>Tue, 02 Jun 2009 17:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40059#M10361</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-02T17:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: datastep inside a macro  type question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40060#M10362</link>
      <description>&amp;gt; Try removing % sign in if-else-then and do-end loop&lt;BR /&gt;
&amp;gt; statments.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt;  ~ Sukanya E&lt;BR /&gt;
&lt;BR /&gt;
It worked perfectly  and Thanks infinitely &lt;BR /&gt;
I guess the issue i had initially was execution time versus interpretation time&lt;BR /&gt;
wasn't ?&lt;BR /&gt;
What do you think i should know about in  order to avoid this kind of problems ?&lt;BR /&gt;
thanks in advance</description>
      <pubDate>Tue, 02 Jun 2009 19:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40060#M10362</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-02T19:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: datastep inside a macro  type question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40061#M10363</link>
      <description>Solid understanding of differences between SAS macro compilation and SAS DATA/PROC step execution.  Also, my suggestion is to always code a RUN; to force SAS code interpretation.&lt;BR /&gt;
&lt;BR /&gt;
A few handy SAS diagnostics commands to use (frequently):&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2; &lt;BR /&gt;
&lt;BR /&gt;
OPTIONS MACROGEN SYMBOLGEN MLOGIC;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
And for DATA step processing, the judicious use of PUTLOG (new with SAS 9) to echo messages during execution, for example:&lt;BR /&gt;
&lt;BR /&gt;
PUTLOG '&amp;gt;DIAG01' / _ALL_;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 02 Jun 2009 19:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/datastep-inside-a-macro-type-question/m-p/40061#M10363</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-06-02T19:09:05Z</dc:date>
    </item>
  </channel>
</rss>

