<?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: Macro %While Operator in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1330#M608</link>
    <description>This is a good question for Technical Support.  You can submit it online at &lt;A href="http://support.sas.com/ctx/supportform/index.jsp" target="_blank"&gt;http://support.sas.com/ctx/supportform/index.jsp&lt;/A&gt; .&lt;BR /&gt;
&lt;BR /&gt;
 -- David Kelley, SAS</description>
    <pubDate>Mon, 28 Aug 2006 16:21:04 GMT</pubDate>
    <dc:creator>David_SAS</dc:creator>
    <dc:date>2006-08-28T16:21:04Z</dc:date>
    <item>
      <title>Macro %While Operator</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1329#M607</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I've got a problem with my macro.&lt;BR /&gt;
Here is the first part of it.&lt;BR /&gt;
&lt;BR /&gt;
%macro castypes(table,x1=,x2=nul,x3=nul,x4=nul,x5=nul) ;&lt;BR /&gt;
	/* nombre de modalités*/&lt;BR /&gt;
	%let i=1 ;&lt;BR /&gt;
	%do %while(&amp;amp;&amp;amp;x&amp;amp;i NE nul) ;&lt;BR /&gt;
	%let i=&amp;amp;i+1;&lt;BR /&gt;
	%end ;&lt;BR /&gt;
%mend ;&lt;BR /&gt;
options symbolgen mlogic mprint ;&lt;BR /&gt;
%castypes(table=estgen,x1=pauvretot,x2=typomen) ;&lt;BR /&gt;
&lt;BR /&gt;
At the end "i" should resolve to 3.&lt;BR /&gt;
&lt;BR /&gt;
Log tells me that he's expecting something numeric in the while condition.&lt;BR /&gt;
Yet the following program works :&lt;BR /&gt;
&lt;BR /&gt;
%macro castypes(table,x1=,x2=nul,x3=nul,x4=nul,x5=nul) ;&lt;BR /&gt;
	/* nombre de modalités*/&lt;BR /&gt;
	%let i=1 ;&lt;BR /&gt;
	%do %while(&amp;amp;&amp;amp;x&amp;amp;i=nul) ;&lt;BR /&gt;
	%let i=&amp;amp;i+1;&lt;BR /&gt;
	%end ;&lt;BR /&gt;
%mend ;&lt;BR /&gt;
options symbolgen mlogic mprint ;&lt;BR /&gt;
%castypes(table=estgen,x1=pauvretot,x2=typomen) ;&lt;BR /&gt;
&lt;BR /&gt;
Since x1 resolves to pauvretot, the condition is wrong the first time. But at least the program works.&lt;BR /&gt;
What's wrong with the first program ?&lt;BR /&gt;
&lt;BR /&gt;
Thank you.</description>
      <pubDate>Fri, 25 Aug 2006 14:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1329#M607</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-08-25T14:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro %While Operator</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1330#M608</link>
      <description>This is a good question for Technical Support.  You can submit it online at &lt;A href="http://support.sas.com/ctx/supportform/index.jsp" target="_blank"&gt;http://support.sas.com/ctx/supportform/index.jsp&lt;/A&gt; .&lt;BR /&gt;
&lt;BR /&gt;
 -- David Kelley, SAS</description>
      <pubDate>Mon, 28 Aug 2006 16:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1330#M608</guid>
      <dc:creator>David_SAS</dc:creator>
      <dc:date>2006-08-28T16:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro %While Operator</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1331#M609</link>
      <description>Does it have something to do with the operator "ne" ?&lt;BR /&gt;
&lt;BR /&gt;
Does it work with the macrolanguage ?</description>
      <pubDate>Mon, 28 Aug 2006 16:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1331#M609</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-08-28T16:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro %While Operator</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1332#M610</link>
      <description>no not NE&lt;BR /&gt;
&lt;BR /&gt;
  your assumptions about  +&lt;BR /&gt;
&lt;BR /&gt;
The answer is visible in the symbolgen generated by your options&lt;BR /&gt;
&lt;BR /&gt;
MLOGIC(CASTYPES):  %LET (variable name is I)&lt;BR /&gt;
SYMBOLGEN:  Macro variable I resolves to 1&lt;BR /&gt;
SYMBOLGEN:  &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;BR /&gt;
SYMBOLGEN:  Macro variable I resolves to 1+1&lt;BR /&gt;
&lt;BR /&gt;
Summing needs to be surrounded by %eval() &lt;BR /&gt;
&lt;BR /&gt;
So, not&lt;BR /&gt;
&lt;BR /&gt;
   %let i=&amp;amp;i+1;&lt;BR /&gt;
&lt;BR /&gt;
but&lt;BR /&gt;
&lt;BR /&gt;
   %let i= %eval( &amp;amp;i+1 );&lt;BR /&gt;
&lt;BR /&gt;
good luck&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Tue, 29 Aug 2006 12:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1332#M610</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-08-29T12:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro %While Operator</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1333#M611</link>
      <description>Thank you very much. I have been waiting for an answer for so long &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
I am sorry.&lt;BR /&gt;
I have learned very recently by myself how to use macrolanguage...</description>
      <pubDate>Tue, 29 Aug 2006 13:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-While-Operator/m-p/1333#M611</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-08-29T13:17:50Z</dc:date>
    </item>
  </channel>
</rss>

