<?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: Multiple do loop to be used in another macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323206#M62080</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20974"&gt;@Mohammad&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your reply. Actually, I receive the following warning message:&lt;/P&gt;
&lt;P&gt;WARNING: Apparent invocation of macro DO_FORME not resolved.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you get that, the compilation of the macro failed. Probably because of the TO instead of %TO.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jan 2017 09:15:07 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-01-08T09:15:07Z</dc:date>
    <item>
      <title>Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323177#M62069</link>
      <description>&lt;P&gt;Hi, folks. I am trying to run this code. The purpose is to use the variables of var list which are changing&amp;nbsp;over time in another macro.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let DEAScorelist=x501 x502 x503;

%macro Do_Forme:
data _null_;
%do i=1 to %sysfunc(coutw(&amp;amp;DEAscorelist));
 %let DEA_score= %scan(&amp;amp;DEAscorelist,&amp;amp;i);
	length line $300;
		%do DTS = 2007 to 2014;
			UTS=DTS+&amp;amp;PT.-1;
			DHS=DTS+&amp;amp;PT.;
			UHS=DTS+&amp;amp;PT.+&amp;amp;PH.-1;
			SDTS=put(DTS,4.);
			SUTS=put(UTS,4.);
			SDHS=put(DHS,4.);
			SUHS=put(UHS,4.);
			DT=substr(SDTS,3,2);
			UT=substr(SUTS,3,2);
			DH=substr(SDHS,3,2);
			UH=substr(SUHS,3,2);
    	line = cats('%nrstr(%merge_scores_results(DTS=', DTS, ',UTS=', UTS, ',DHS=', DHS, ',UHS=', UHS, ',DT=', DT, ',UT=',UT, ',DH=' ,DH, ',UH=' ,UH, ',DEA_score=' ,DEA_score, '));');
    	call execute(line);
  		%end;
  %end;
	run;
%mend Do_Forme;



%Do_Forme;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Would you please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 21:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323177#M62069</guid>
      <dc:creator>Mohammad</dc:creator>
      <dc:date>2017-01-07T21:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323178#M62070</link>
      <description>&lt;P&gt;What's the question?&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 23:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323178#M62070</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-07T23:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323179#M62071</link>
      <description>Reeza. It doesn't work.</description>
      <pubDate>Sat, 07 Jan 2017 23:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323179#M62071</guid>
      <dc:creator>Mohammad</dc:creator>
      <dc:date>2017-01-07T23:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323180#M62072</link>
      <description>&lt;P&gt;I guess your mixing macro code with datastep code causes the issue.&lt;/P&gt;
&lt;P&gt;Since (as it seems to me) all you want to do is call a macro repeatedly with call execute, the loops can be done with data step code alone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, "it does not work" is on par with "a bicycle was stolen in Beijing". Don't force us to make guesses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 23:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323180#M62072</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-07T23:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323182#M62073</link>
      <description>&lt;P&gt;A %DO loop should use %TO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 23:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323182#M62073</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-07T23:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323202#M62079</link>
      <description>&lt;P&gt;Thanks for your reply. Actually, I receive the following warning message:&lt;/P&gt;&lt;P&gt;WARNING: Apparent invocation of macro DO_FORME not resolved.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 08:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323202#M62079</guid>
      <dc:creator>Mohammad</dc:creator>
      <dc:date>2017-01-08T08:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323206#M62080</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20974"&gt;@Mohammad&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your reply. Actually, I receive the following warning message:&lt;/P&gt;
&lt;P&gt;WARNING: Apparent invocation of macro DO_FORME not resolved.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you get that, the compilation of the macro failed. Probably because of the TO instead of %TO.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 09:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323206#M62080</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-08T09:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple do loop to be used in another macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323399#M62093</link>
      <description>&lt;P&gt;In addition to likely macro and datastep&amp;nbsp;loop confusion you are referencing macro variables PT&amp;nbsp; and PH&amp;nbsp; with out any clue as to what they may look like. So a failure for your DO_Forme macro may fail because of values of those variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what I see inside your macro there is no need for macro loop processsing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should run your macro with the system options MPRINT and SYMBOLGEN at least once. You may get some ideas of where the actual problem is as well as hints as to why you don't want the %do DTS to be a macro loop. Note that %do DTS creates a macro varaible. So all of your other references to DTS are a missing datastep variable. And any missing value + something will be missing.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2017 16:16:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Multiple-do-loop-to-be-used-in-another-macro/m-p/323399#M62093</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-09T16:16:55Z</dc:date>
    </item>
  </channel>
</rss>

