<?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 Macro within a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76390#M16517</link>
    <description>I am trying to read in multiple datasets that are stored by year/grade.  I have a macro which works to read in all the grades for the first year, but fails to continue onto the second year.  Can anyone give some suggestions as to what might be happening here?  I am getting no errors, just termination after creategrade runs through the loop 6 times.&lt;BR /&gt;
&lt;BR /&gt;
%macro createyear(num);&lt;BR /&gt;
%LET year = 97;&lt;BR /&gt;
%DO I = 1 %to &amp;amp;num;&lt;BR /&gt;
	%macro creategrade(howmany);&lt;BR /&gt;
	%LET grade = 3;&lt;BR /&gt;
	%DO I = 1 %to &amp;amp;howmany;&lt;BR /&gt;
		data eog&amp;amp;grade.pub&amp;amp;year._1;&lt;BR /&gt;
		set eogsing2.eog&amp;amp;grade.pub&amp;amp;year._1;&lt;BR /&gt;
&lt;BR /&gt;
		stdread=readscal;&lt;BR /&gt;
		stdmath=mathscal;&lt;BR /&gt;
&lt;BR /&gt;
		proc standard data=eog&amp;amp;grade.pub&amp;amp;year._1 mean=0 std=1 out=eog&amp;amp;grade.pub&amp;amp;year._1;&lt;BR /&gt;
  			var stdread stdmath;&lt;BR /&gt;
		run;&lt;BR /&gt;
		%LET grade =%eval(&amp;amp;grade+1);&lt;BR /&gt;
	%END;&lt;BR /&gt;
	%mend creategrade;&lt;BR /&gt;
	%creategrade(6);&lt;BR /&gt;
	%LET year =%eval(&amp;amp;year+1);&lt;BR /&gt;
%END;&lt;BR /&gt;
%mend createyear;&lt;BR /&gt;
%createyear(2);</description>
    <pubDate>Thu, 05 Mar 2009 17:29:06 GMT</pubDate>
    <dc:creator>MGaddis</dc:creator>
    <dc:date>2009-03-05T17:29:06Z</dc:date>
    <item>
      <title>Macro within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76390#M16517</link>
      <description>I am trying to read in multiple datasets that are stored by year/grade.  I have a macro which works to read in all the grades for the first year, but fails to continue onto the second year.  Can anyone give some suggestions as to what might be happening here?  I am getting no errors, just termination after creategrade runs through the loop 6 times.&lt;BR /&gt;
&lt;BR /&gt;
%macro createyear(num);&lt;BR /&gt;
%LET year = 97;&lt;BR /&gt;
%DO I = 1 %to &amp;amp;num;&lt;BR /&gt;
	%macro creategrade(howmany);&lt;BR /&gt;
	%LET grade = 3;&lt;BR /&gt;
	%DO I = 1 %to &amp;amp;howmany;&lt;BR /&gt;
		data eog&amp;amp;grade.pub&amp;amp;year._1;&lt;BR /&gt;
		set eogsing2.eog&amp;amp;grade.pub&amp;amp;year._1;&lt;BR /&gt;
&lt;BR /&gt;
		stdread=readscal;&lt;BR /&gt;
		stdmath=mathscal;&lt;BR /&gt;
&lt;BR /&gt;
		proc standard data=eog&amp;amp;grade.pub&amp;amp;year._1 mean=0 std=1 out=eog&amp;amp;grade.pub&amp;amp;year._1;&lt;BR /&gt;
  			var stdread stdmath;&lt;BR /&gt;
		run;&lt;BR /&gt;
		%LET grade =%eval(&amp;amp;grade+1);&lt;BR /&gt;
	%END;&lt;BR /&gt;
	%mend creategrade;&lt;BR /&gt;
	%creategrade(6);&lt;BR /&gt;
	%LET year =%eval(&amp;amp;year+1);&lt;BR /&gt;
%END;&lt;BR /&gt;
%mend createyear;&lt;BR /&gt;
%createyear(2);</description>
      <pubDate>Thu, 05 Mar 2009 17:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76390#M16517</guid>
      <dc:creator>MGaddis</dc:creator>
      <dc:date>2009-03-05T17:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76391#M16518</link>
      <description>I expect you might find macro compilation diagnostics to address your problem - try adding the following statement to your program:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MLOGIC;&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 05 Mar 2009 17:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76391#M16518</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-03-05T17:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro within a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76392#M16519</link>
      <description>Thank you very much.  I am silly...I used "I" twice, so of course it wouldn't continue.</description>
      <pubDate>Thu, 05 Mar 2009 17:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-within-a-macro/m-p/76392#M16519</guid>
      <dc:creator>MGaddis</dc:creator>
      <dc:date>2009-03-05T17:44:33Z</dc:date>
    </item>
  </channel>
</rss>

