<?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: Go to the end of a Macro loop when condition met in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435952#M108342</link>
    <description>&lt;P&gt;Looks right.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Feb 2018 15:49:52 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-02-10T15:49:52Z</dc:date>
    <item>
      <title>Go to the end of a Macro loop when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435948#M108338</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to end an iteration and move to a new iteration when sample size is less than 5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please help me with that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you and have a nice weekend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test;
	%do i=1 %to 100;&lt;BR /&gt;
		%do J=1 %to 100;

		LOT OF ANALYSIS;

		PROC SQL; SELECT COUNT(*) INTO: SAMPLE_SIZE FROM HAVE;QUIT;

		&lt;FONT color="#0000FF"&gt;%IF &amp;amp;SAMPLE_SIZE&amp;lt;5 %THEN&lt;/FONT&gt; &lt;FONT color="#FF0000"&gt;END THE INNER-LOOP (J)&lt;/FONT&gt;

		LOT OF ANALYSIS;

		%end;

	%end;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KEY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test;
	%do i=1 %to %sysfunc(countw(&amp;amp;rr_list));
		%do J=1 %to %sysfunc(countw(&amp;amp;sl_list));

		LOT OF ANALYSIS;

		PROC SQL; SELECT COUNT(*) INTO: SAMPLE_SIZE FROM HAVE;QUIT;

		%IF &amp;amp;SAMPLE_SIZE&amp;lt;5 %THEN %GOTO EXIT_EXIT_EXIT;

		LOT OF ANALYSIS;

		%EXIT_EXIT_EXIT;

		%end;

	%end;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 21:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435948#M108338</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-29T21:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Go to the end of a Macro loop when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435949#M108339</link>
      <description>&lt;P&gt;you can use the &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000209058.htm" target="_self"&gt;%GOTO Macro Statement&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 15:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435949#M108339</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-02-10T15:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Go to the end of a Macro loop when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435950#M108340</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;So it will be like that, right?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO test;
	%do i=1 %to %sysfunc(countw(&amp;amp;rr_list));
		%do J=1 %to %sysfunc(countw(&amp;amp;sl_list));

		LOT OF ANALYSIS;

		PROC SQL; SELECT COUNT(*) INTO: SAMPLE_SIZE FROM HAVE;QUIT;

		%IF &amp;amp;SAMPLE_SIZE&amp;lt;5 %THEN %GOTO EXIT_EXIT_EXIT;

		LOT OF ANALYSIS;

		%EXIT_EXIT_EXIT:

		%end;

	%end;
%MEND;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 15:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435950#M108340</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2018-02-10T15:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Go to the end of a Macro loop when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435951#M108341</link>
      <description>&lt;P&gt;I think you want to replace the semi-colon after&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%EXIT_EXIT_EXIT;&lt;/PRE&gt;
&lt;P&gt;with a colon (i.e., : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 17:13:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435951#M108341</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-02-10T17:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Go to the end of a Macro loop when condition met</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435952#M108342</link>
      <description>&lt;P&gt;Looks right.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 15:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Go-to-the-end-of-a-Macro-loop-when-condition-met/m-p/435952#M108342</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-02-10T15:49:52Z</dc:date>
    </item>
  </channel>
</rss>

