<?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 Loop for Forecast Years in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227665#M5502</link>
    <description>&lt;P&gt;Well, that data is missing some of the used variables. &amp;nbsp;However I can provide an example:&lt;/P&gt;&lt;P&gt;data inter;&lt;BR /&gt;&amp;nbsp; set tmp.exampleforecast;&lt;BR /&gt;&amp;nbsp; array l201{7} l201_fy16-l201_fy22;&lt;BR /&gt;&amp;nbsp; array l202{7} l202_fy16-l202_fy22;&lt;BR /&gt;&amp;nbsp; array l203{7} l203_fy16-l203_fy22;&lt;BR /&gt;&amp;nbsp; array l204{7} l204_fy16-l204_fy22;&lt;/P&gt;&lt;P&gt;/* the other 8 here */&lt;BR /&gt;&amp;nbsp; do i=2 to 7; /* as 1 does not have previous */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 1201{i}=1203{i-1};&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 1202{i}=round(scpp*spg_fy...); /* these variables are not in the data you supplied */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 1203{i}=...&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above I create an array for each of the 12 sections. &amp;nbsp;For these groups I then loop over and perform the given calculation using the incrementor i and point the calculation at i-1, or the previous year. Hence I start from 2 rather than 1 as there is no previous from the first year. &amp;nbsp;You can play around with the above, its quite simple when you understand the mechanics of the arrays.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2015 14:19:31 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-09-29T14:19:31Z</dc:date>
    <item>
      <title>Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227584#M5491</link>
      <description>&lt;P&gt;I&amp;nbsp;&lt;SPAN&gt; have a SAS program that has a base year of data and five forecast years. All the forecast years have the same calculations, but just use the prior year's data as the base year for calculations. I want to avoid copying the data 5 times and just changing the suffix of my variable names. It would be great to have just one forecast year and have a do loop or an array to change the suffix of the variable names. &amp;nbsp;Here is my current code and I attached my Log:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;*Start macro loop - takes two parameters, the first year of the dataset to be created and the last year;&lt;BR /&gt;Options Mprint Symbolgen;&lt;BR /&gt;%macro loop(year_start, year_end);&lt;BR /&gt;&lt;BR /&gt; *loop over years;&lt;BR /&gt;&lt;BR /&gt; %do year=&amp;amp;year_start %to &amp;amp;year_end;&lt;BR /&gt; *create macro variable for previous years;&lt;BR /&gt; %let prev_year=%eval(&amp;amp;year_start-1);&lt;BR /&gt;&lt;BR /&gt;DATA SchoolAidFY&amp;amp;year_start.;&lt;BR /&gt;Set work.forecastinputs;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;* COST PER PUPIL AMOUNTS; &lt;BR /&gt;L201_FY&amp;amp;start_year.= L203_FY&amp;amp;prev_year.; &lt;BR /&gt;L202_FY&amp;amp;start_year.= Round(SCPP*SPG_FY&amp;amp;start_year.,1); &lt;BR /&gt;L203_FY&amp;amp;start_year.= Sum(L201_FY&amp;amp;start_year.,L202_FY&amp;amp;start_year.); &lt;BR /&gt;L204_FY&amp;amp;start_year.= L206_FY&amp;amp;prev_year.; &lt;BR /&gt;L205_FY&amp;amp;start_year.= Round(TS_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L206_FY&amp;amp;start_year.= Sum(L204_FY&amp;amp;start_year.,L205_FY&amp;amp;start_year.); &lt;BR /&gt;L207_FY&amp;amp;start_year.= L209_FY&amp;amp;prev_year.; &lt;BR /&gt;L208_FY&amp;amp;start_year.= Round(PD_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L209_FY&amp;amp;start_year.= Sum(L207_FY&amp;amp;start_year.,L208_FY&amp;amp;start_year.); &lt;BR /&gt;L210_FY&amp;amp;start_year.= L212_FY&amp;amp;prev_year.; &lt;BR /&gt;L211_FY&amp;amp;start_year.= Round(EI_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L212_FY&amp;amp;start_year.= Sum(L210_FY&amp;amp;start_year.,L211_FY&amp;amp;start_year.); &lt;BR /&gt;L213_FY&amp;amp;start_year.= L215_FY&amp;amp;prev_year.; &lt;BR /&gt;L214_FY&amp;amp;start_year.= Round(TL_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L215_FY&amp;amp;start_year.= Sum(L213_FY&amp;amp;start_year.,L214_FY&amp;amp;start_year.); &lt;BR /&gt;&lt;BR /&gt; Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; %end;&lt;BR /&gt; *end of do loop;&lt;BR /&gt;&lt;BR /&gt; %mend;&lt;BR /&gt; *end of macro; &lt;BR /&gt;&lt;BR /&gt; %loop(year_start=17, year_end=20);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 22:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227584#M5491</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-28T22:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227585#M5492</link>
      <description>&lt;P&gt;The macro parameter is year_start but you're using start_year (or maybe I did in my sample code ;))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure they're all the same, copy and paste is your friend...sometimes!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 22:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227585#M5492</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-28T22:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227586#M5493</link>
      <description>&lt;P&gt;Excellent!!! Good catch, I should have been looking closer. &amp;nbsp;That fixed it so i have an output now for FY17. &amp;nbsp;However, the other years are not being added to the dataset. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 22:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227586#M5493</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-28T22:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227587#M5494</link>
      <description>&lt;P&gt;It looks like your loop is in the wrong place. &amp;nbsp;Each iteration of the loop takes FORECASTINPUTS as the incoming data. &amp;nbsp;To get everything in one output data set, try moving the DATA and SET statements to just before the %DO statement.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 22:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227587#M5494</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-09-28T22:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227589#M5495</link>
      <description>Your question here is different than your original question. Do you want a single data set output or multiple output datasets?</description>
      <pubDate>Mon, 28 Sep 2015 23:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227589#M5495</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-28T23:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227638#M5496</link>
      <description>&lt;P&gt;Can I ask you post some sample data in the form of a datastep and what the output should look like. &amp;nbsp;Seems to be a simple loop to my mind, create a dataset which is normalised, e.g. parameter, value - output. &amp;nbsp;Oy alternatively arrays, but you look like yuo could end up with quite a few columns which tends to be messy. &amp;nbsp;Without seeing data I can't tell.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227638#M5496</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-09-29T12:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227646#M5498</link>
      <description>&lt;P&gt;Correct, originally i thought i would have to have separate data set outputs, but if it is easier I am fine with everything being in a single data set output.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:50:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227646#M5498</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-29T12:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227648#M5499</link>
      <description>&lt;P&gt;This gives me an error that my statements are not valid or used out of proper order. &amp;nbsp;I attached the Log.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227648#M5499</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-29T12:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227654#M5501</link>
      <description>&lt;P&gt;Here is the Sample data. &amp;nbsp;It will have many columns in the end.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 13:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227654#M5501</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-29T13:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227665#M5502</link>
      <description>&lt;P&gt;Well, that data is missing some of the used variables. &amp;nbsp;However I can provide an example:&lt;/P&gt;&lt;P&gt;data inter;&lt;BR /&gt;&amp;nbsp; set tmp.exampleforecast;&lt;BR /&gt;&amp;nbsp; array l201{7} l201_fy16-l201_fy22;&lt;BR /&gt;&amp;nbsp; array l202{7} l202_fy16-l202_fy22;&lt;BR /&gt;&amp;nbsp; array l203{7} l203_fy16-l203_fy22;&lt;BR /&gt;&amp;nbsp; array l204{7} l204_fy16-l204_fy22;&lt;/P&gt;&lt;P&gt;/* the other 8 here */&lt;BR /&gt;&amp;nbsp; do i=2 to 7; /* as 1 does not have previous */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 1201{i}=1203{i-1};&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 1202{i}=round(scpp*spg_fy...); /* these variables are not in the data you supplied */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 1203{i}=...&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above I create an array for each of the 12 sections. &amp;nbsp;For these groups I then loop over and perform the given calculation using the incrementor i and point the calculation at i-1, or the previous year. Hence I start from 2 rather than 1 as there is no previous from the first year. &amp;nbsp;You can play around with the above, its quite simple when you understand the mechanics of the arrays.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 14:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227665#M5502</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-09-29T14:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227667#M5503</link>
      <description>&lt;P&gt;Like I stated above, your question here is being phrased different that it was originally stated.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw﻿&lt;/a&gt;&amp;nbsp;is correct regarding moving the loop to inside the data step, but&amp;nbsp;@rw9 is more correct (?) in that an array is a better solution if you want a single data set. If you had wanted multiple data sets, as in your original question, then the macro was required. But you've edited that question so I can't even link back to it....&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;
&lt;PRE&gt;%macro loop(year_start, year_end);&lt;BR /&gt;&lt;BR /&gt; *loop over years;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DATA SchoolAidFY&amp;amp;year_start.;&lt;BR /&gt;Set work.forecastinputs;&lt;BR /&gt;&lt;BR /&gt; %do year=&amp;amp;year_start %to &amp;amp;year_end;&lt;BR /&gt; *create macro variable for previous years;&lt;BR /&gt; %let prev_year=%eval(&amp;amp;year_start-1);&lt;BR /&gt;&lt;BR /&gt;* COST PER PUPIL AMOUNTS; &lt;BR /&gt;L201_FY&amp;amp;start_year.= L203_FY&amp;amp;prev_year.; &lt;BR /&gt;L202_FY&amp;amp;start_year.= Round(SCPP*SPG_FY&amp;amp;start_year.,1); &lt;BR /&gt;L203_FY&amp;amp;start_year.= Sum(L201_FY&amp;amp;start_year.,L202_FY&amp;amp;start_year.); &lt;BR /&gt;L204_FY&amp;amp;start_year.= L206_FY&amp;amp;prev_year.; &lt;BR /&gt;L205_FY&amp;amp;start_year.= Round(TS_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L206_FY&amp;amp;start_year.= Sum(L204_FY&amp;amp;start_year.,L205_FY&amp;amp;start_year.); &lt;BR /&gt;L207_FY&amp;amp;start_year.= L209_FY&amp;amp;prev_year.; &lt;BR /&gt;L208_FY&amp;amp;start_year.= Round(PD_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L209_FY&amp;amp;start_year.= Sum(L207_FY&amp;amp;start_year.,L208_FY&amp;amp;start_year.); &lt;BR /&gt;L210_FY&amp;amp;start_year.= L212_FY&amp;amp;prev_year.; &lt;BR /&gt;L211_FY&amp;amp;start_year.= Round(EI_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L212_FY&amp;amp;start_year.= Sum(L210_FY&amp;amp;start_year.,L211_FY&amp;amp;start_year.); &lt;BR /&gt;L213_FY&amp;amp;start_year.= L215_FY&amp;amp;prev_year.; &lt;BR /&gt;L214_FY&amp;amp;start_year.= Round(TL_SCPP*SPG_FY&amp;amp;start_year.,0.01); &lt;BR /&gt;L215_FY&amp;amp;start_year.= Sum(L213_FY&amp;amp;start_year.,L214_FY&amp;amp;start_year.); &lt;BR /&gt;&lt;BR /&gt;%end;&lt;BR /&gt; Run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; %end;&lt;BR /&gt; *end of do loop;&lt;BR /&gt;&lt;BR /&gt; %mend;&lt;BR /&gt; *end of macro; &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 14:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227667#M5503</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-29T14:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227680#M5508</link>
      <description>&lt;P&gt;I did not realized the change from single to multiple data sets. &amp;nbsp;It would be best if i have multiple data sets because my code has over 750 lines on calculations. &amp;nbsp;I am still getting errors in my log. &amp;nbsp;So here is my new code based on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;comments and&amp;nbsp;moving the Data step to before the %do: &amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro loop(year_start, year_end);


*loop over years;



DATA SchoolAidFY&amp;amp;year_start.;
Set work.SchoolAidFY&amp;amp;prev_year.;

  %do year=&amp;amp;year_start %to &amp;amp;year_end;
  *create macro variable for previous years;
  %let prev_year=%eval(&amp;amp;year_start-1);

/*DATA SchoolAidFY&amp;amp;year_start.;*/
/*Set work.forecastinputs;*/




* COST PER PUPIL AMOUNTS;						
L201_FY&amp;amp;year_start.=	L203_FY&amp;amp;prev_year.;								
L202_FY&amp;amp;year_start.=		Round(SCPP*SPG_FY&amp;amp;year_start.,1);			
L203_FY&amp;amp;year_start.=		Sum(L201_FY&amp;amp;year_start.,L202_FY&amp;amp;year_start.);					
L204_FY&amp;amp;year_start.=	L206_FY&amp;amp;prev_year.;						
L205_FY&amp;amp;year_start.=		Round(TS_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L206_FY&amp;amp;year_start.=		Sum(L204_FY&amp;amp;year_start.,L205_FY&amp;amp;year_start.);				
L207_FY&amp;amp;year_start.=	L209_FY&amp;amp;prev_year.;						
L208_FY&amp;amp;year_start.=		Round(PD_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L209_FY&amp;amp;year_start.=		Sum(L207_FY&amp;amp;year_start.,L208_FY&amp;amp;year_start.);			
L210_FY&amp;amp;year_start.=	L212_FY&amp;amp;prev_year.;						
L211_FY&amp;amp;year_start.=		Round(EI_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L212_FY&amp;amp;year_start.=		Sum(L210_FY&amp;amp;year_start.,L211_FY&amp;amp;year_start.);				
L213_FY&amp;amp;year_start.=	L215_FY&amp;amp;prev_year.;						
L214_FY&amp;amp;year_start.=		Round(TL_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L215_FY&amp;amp;year_start.=		Sum(L213_FY&amp;amp;year_start.,L214_FY&amp;amp;year_start.);					

 Run;


  %end;
  *end of do loop;

  %mend;
  *end of macro;   


 %loop(year_start=17, year_end=22);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2015 15:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227680#M5508</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-29T15:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227692#M5512</link>
      <description>&lt;P&gt;Your RUN; statement also needs to be moved, to later in the program.&amp;nbsp; Right now it is part of the macro loop, so the program generates multiple RUN; statements.&amp;nbsp; Move it outside of the loop, to right after the program calls the looping macro.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 15:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227692#M5512</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-09-29T15:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227707#M5514</link>
      <description>If you've changed your SET statement to take the previous years data, use my original code with the do loop OUTSIDE of the data step.  You've switched back and that change is no longer valid.</description>
      <pubDate>Tue, 29 Sep 2015 16:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227707#M5514</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-09-29T16:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227729#M5516</link>
      <description>&lt;P&gt;Excellent. &amp;nbsp;Seems to be working now, but still getting only the Start Year Data Set:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Start macro loop - takes two parameters, the first year of the dataset to be created and the last year;

%macro loop(year_start, year_end);


*loop over years;

  %do year=&amp;amp;year_start %to &amp;amp;year_end;
  *create macro variable for previous years;
  %let prev_year=%eval(&amp;amp;year_start-1);

DATA SchoolAidFY&amp;amp;year_start.;
Set work.schoolaidfy&amp;amp;prev_year.;




* COST PER PUPIL AMOUNTS;						
L201_FY&amp;amp;year_start.=	L203_FY&amp;amp;prev_year.;								
L202_FY&amp;amp;year_start.=		Round(SCPP*SPG_FY&amp;amp;year_start.,1);			
L203_FY&amp;amp;year_start.=		Sum(L201_FY&amp;amp;year_start.,L202_FY&amp;amp;year_start.);					
L204_FY&amp;amp;year_start.=	L206_FY&amp;amp;prev_year.;						
L205_FY&amp;amp;year_start.=		Round(TS_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L206_FY&amp;amp;year_start.=		Sum(L204_FY&amp;amp;year_start.,L205_FY&amp;amp;year_start.);				
L207_FY&amp;amp;year_start.=	L209_FY&amp;amp;prev_year.;						
L208_FY&amp;amp;year_start.=		Round(PD_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L209_FY&amp;amp;year_start.=		Sum(L207_FY&amp;amp;year_start.,L208_FY&amp;amp;year_start.);			
L210_FY&amp;amp;year_start.=	L212_FY&amp;amp;prev_year.;						
L211_FY&amp;amp;year_start.=		Round(EI_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L212_FY&amp;amp;year_start.=		Sum(L210_FY&amp;amp;year_start.,L211_FY&amp;amp;year_start.);				
L213_FY&amp;amp;year_start.=	L215_FY&amp;amp;prev_year.;						
L214_FY&amp;amp;year_start.=		Round(TL_SCPP*SPG_FY&amp;amp;year_start.,0.01);		
L215_FY&amp;amp;year_start.=		Sum(L213_FY&amp;amp;year_start.,L214_FY&amp;amp;year_start.);					




  %end;
  *end of do loop;

  %mend;
  *end of macro;   


 %loop(year_start=17,year_end=19);

Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2015 18:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227729#M5516</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-09-29T18:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227987#M5528</link>
      <description>&lt;P&gt;Well, the syntax errors are gone. &amp;nbsp;It becomes how to get from where you are now to what you need. &amp;nbsp;There may be more than one way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you should generate one huge data set with all the variables in it, and then separate out the variables into subsets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you should add another macro loop outside of all the current looping. &amp;nbsp;One new macro loop controls the generation of a data set, and the interior macro loop (the one that you have now) controls the generation of variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's really a question that you have to address. &amp;nbsp;Compare what you have now to what you need. &amp;nbsp;You're the one that can summarize what else needs to happen at this point.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 02:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/227987#M5528</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-10-01T02:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop for Forecast Years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/228060#M5534</link>
      <description>&lt;P&gt;I will take your suggestion and generate one data set with all the variables in it. &amp;nbsp;That means I go back to using arrays? &amp;nbsp;I have been experimenting with the arrays but get&amp;nbsp;the following errors that my variables have been defined and not declared as an array.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data SchoolAidForecast;
Set work.forecastinputs;

/*State Supplemental Assistance	*/
SPG_FY17 = 0.0200;	* FY 2017 State Percent of Growth;
SPG_FY18 = 0.0400;	* FY 2018 State Percent of Growth;
SPG_FY19 = 0.0400;	* FY 2019 State Percent of Growth;
SPG_FY20 = 0.0400;	* FY 2020 State Percent of Growth;
SPG_FY21 = 0.0400;	* FY 2021 State Percent of Growth;
SPG_FY22 = 0.0400;	* FY 2022 State Percent of Growth;

CPP_FY17 = Round(SCPP*SPG_FY17,1);	* FY 2017 Cost Per Pupil Amount;
SCPP_FY17 = SCPP+CPP_FY17;   *FY 2017 State Cost Per Pupil;

SCPP_AEA_FY17 = SCPP_FY17;   *FY 2017 State Cost Per Pupil for AEA;

TS_CPP_FY17 = Round(TS_CPP*SPG_FY17,0.01); * FY 2017 Cost Per Pupil Amount Teacher Salary;
TS_SCPP_FY17 = TS_SCPP+TS_CPP_FY17;   *FY 2017 State Cost Per Pupil Teacher Salary;
PD_CPP_FY17 = Round(PD_CPP*SPG_FY17,0.01); * FY 2017 Cost Per Pupil Amount Professional Development;
PD_SCPP_FY17 = PD_SCPP+PD_CPP_FY17;   *FY 2017 State Cost Per Pupil Professional Development;
EI_CPP_FY17 = Round(EI_CPP*SPG_FY17,0.01); * FY 2017 Cost Per Pupil Amount Early Intervention;
EI_SCPP_FY17 = EI_SCPP+EI_CPP_FY17;   *FY 2017 State Cost Per Pupil Early Intervention;
TL_CPP_FY17 = Round(TL_CPP*SPG_FY17,0.01); * FY 2017 Cost Per Pupil Amount Teacher Leadership;
TL_SCPP_FY17 = TL_SCPP+TL_CPP_FY17;   *FY 2017 State Cost Per Pupil Teacher Leadership;

AEA_SPED_SCPP_FY17 = Round(AEA_SPED_SCPP*SPG_FY17,0.01); * FY 2017 State Cost Per Pupil AEA Special Education;
AEAMED_SCPP_FY17 = Round(AEAMED_SCPP*SPG_FY17,0.01);    * FY 2017 State Cost Per Pupil AEA Media;
AEAED_SCPP_FY17 = Round(AEAED_SCPP*SPG_FY17,0.01);    * FY 2017 State Cost Per Pupil AEA Ed Support;
TS_AEA_SCPP_FY17 = Round(TS_AEA_SCPP*SPG_FY17,0.01);    * FY 2017 State Cost Per Pupil AEA Teacher Salary;
PD_AEA_SCPP_FY17 = Round(PD_AEA_SCPP*SPG_FY17,0.01);    * FY 2017 State Cost Per Pupil AEA Professional Development;

/*FY 2018 Cost Per Pupil amounts*/

CPP_FY18 = Round(SCPP_FY17*SPG_FY18,1);	* FY 2018 Cost Per Pupil Amount;
SCPP_FY18 = SCPP_FY17+CPP_FY18;   *FY 2018 State Cost Per Pupil;

SCPP_AEA_FY18 = SCPP_FY18;   *FY 2018 State Cost Per Pupil for AEA;

TS_CPP_FY18 = Round(TS_CPP_FY17*SPG_FY18,0.01); * FY 2018 Cost Per Pupil Amount Teacher Salary;
TS_SCPP_FY18 = TS_SCPP_FY17+TS_CPP_FY18;   *FY 2018 State Cost Per Pupil Teacher Salary;
PD_CPP_FY18 = Round(PD_CPP_FY17*SPG_FY18,0.01); * FY 2018 Cost Per Pupil Amount Professional Development;
PD_SCPP_FY18 = PD_SCPP_FY17+PD_CPP_FY18;   *FY 2018 State Cost Per Pupil Professional Development;
EI_CPP_FY18 = Round(EI_CPP_FY17*SPG_FY18,0.01); * FY 2018 Cost Per Pupil Amount Early Intervention;
EI_SCPP_FY18 = EI_SCPP_FY17+EI_CPP_FY18;   *FY 2018 State Cost Per Pupil Early Intervention;
TL_CPP_FY18 = Round(TL_CPP_FY17*SPG_FY18,0.01); * FY 2018 Cost Per Pupil Amount Teacher Leadership;
TL_SCPP_FY18 = TL_SCPP_FY17+TL_CPP_FY18;   *FY 2018 State Cost Per Pupil Teacher Leadership;

AEA_SPED_SCPP_FY18 = Round(AEA_SPED_SCPP_FY17*SPG_FY18,0.01); * FY 2018 State Cost Per Pupil AEA Special Education;
AEAMED_SCPP_FY18 = Round(AEAMED_SCPP_FY17*SPG_FY18,0.01);    * FY 2018 State Cost Per Pupil AEA Media;
AEAED_SCPP_FY18 = Round(AEAED_SCPP_FY17*SPG_FY18,0.01);    * FY 2018 State Cost Per Pupil AEA Ed Support;
TS_AEA_SCPP_FY18 = Round(TS_AEA_SCPP_FY17*SPG_FY18,0.01);    * FY 2018 State Cost Per Pupil AEA Teacher Salary;
PD_AEA_SCPP_FY18 = Round(PD_AEA_SCPP_FY17*SPG_FY18,0.01);    * FY 2018 State Cost Per Pupil AEA Professional Development;

/*FY 2019 Cost Per Pupil amounts*/

CPP_FY19 = Round(SCPP_FY18*SPG_FY19,1);	* FY 2019 Cost Per Pupil Amount;
SCPP_FY19 = SCPP_FY18+CPP_FY19;   *FY 2019 State Cost Per Pupil;

SCPP_AEA_FY19 = SCPP_FY19;   *FY 2019 State Cost Per Pupil for AEA;

TS_CPP_FY19 = Round(TS_CPP_FY18*SPG_FY19,0.01); * FY 2019 Cost Per Pupil Amount Teacher Salary;
TS_SCPP_FY19 = TS_SCPP_FY18+TS_CPP_FY19;   *FY 2019 State Cost Per Pupil Teacher Salary;
PD_CPP_FY19 = Round(PD_CPP_FY18*SPG_FY19,0.01); * FY 2019 Cost Per Pupil Amount Professional Development;
PD_SCPP_FY19 = PD_SCPP_FY18+PD_CPP_FY19;   *FY 2019 State Cost Per Pupil Professional Development;
EI_CPP_FY19 = Round(EI_CPP_FY18*SPG_FY19,0.01); * FY 2019 Cost Per Pupil Amount Early Intervention;
EI_SCPP_FY19 = EI_SCPP_FY18+EI_CPP_FY19;   *FY 2019 State Cost Per Pupil Early Intervention;
TL_CPP_FY19 = Round(TL_CPP_FY18*SPG_FY19,0.01); * FY 2019 Cost Per Pupil Amount Teacher Leadership;
TL_SCPP_FY19 = TL_SCPP_FY18+TL_CPP_FY19;   *FY 2019 State Cost Per Pupil Teacher Leadership;

AEA_SPED_SCPP_FY19 = Round(AEA_SPED_SCPP_FY18*SPG_FY19,0.01); * FY 2019 State Cost Per Pupil AEA Special Education;
AEAMED_SCPP_FY19 = Round(AEAMED_SCPP_FY18*SPG_FY19,0.01);    * FY 2019 State Cost Per Pupil AEA Media;
AEAED_SCPP_FY19 = Round(AEAED_SCPP_FY18*SPG_FY19,0.01);    * FY 2019 State Cost Per Pupil AEA Ed Support;
TS_AEA_SCPP_FY19 = Round(TS_AEA_SCPP_FY18*SPG_FY19,0.01);    * FY 2019 State Cost Per Pupil AEA Teacher Salary;
PD_AEA_SCPP_FY19 = Round(PD_AEA_SCPP_FY18*SPG_FY19,0.01);    * FY 2019 State Cost Per Pupil AEA Professional Development;

/*FY 2020 Cost Per Pupil amounts*/

CPP_FY20 = Round(SCPP_FY19*SPG_FY20,1);	* FY 2020 Cost Per Pupil Amount;
SCPP_FY20 = SCPP_FY19+CPP_FY20;   *FY 2020 State Cost Per Pupil;

SCPP_AEA_FY20 = SCPP_FY20;   *FY 2020 State Cost Per Pupil for AEA;

TS_CPP_FY20 = Round(TS_CPP_FY19*SPG_FY20,0.01); * FY 2020 Cost Per Pupil Amount Teacher Salary;
TS_SCPP_FY20 = TS_SCPP_FY19+TS_CPP_FY20;   *FY 2020 State Cost Per Pupil Teacher Salary;
PD_CPP_FY20 = Round(PD_CPP_FY19*SPG_FY20,0.01); * FY 2020 Cost Per Pupil Amount Professional Development;
PD_SCPP_FY20 = PD_SCPP_FY19+PD_CPP_FY20;   *FY 2020 State Cost Per Pupil Professional Development;
EI_CPP_FY20 = Round(EI_CPP_FY19*SPG_FY20,0.01); * FY 2020 Cost Per Pupil Amount Early Intervention;
EI_SCPP_FY20 = EI_SCPP_FY19+EI_CPP_FY20;   *FY 2020 State Cost Per Pupil Early Intervention;
TL_CPP_FY20 = Round(TL_CPP_FY19*SPG_FY20,0.01); * FY 2020 Cost Per Pupil Amount Teacher Leadership;
TL_SCPP_FY20 = TL_SCPP_FY19+TL_CPP_FY20;   *FY 2020 State Cost Per Pupil Teacher Leadership;

AEA_SPED_SCPP_FY20 = Round(AEA_SPED_SCPP_FY19*SPG_FY20,0.01); * FY 2020 State Cost Per Pupil AEA Special Education;
AEAMED_SCPP_FY20 = Round(AEAMED_SCPP_FY19*SPG_FY20,0.01);    * FY 2020 State Cost Per Pupil AEA Media;
AEAED_SCPP_FY20 = Round(AEAED_SCPP_FY19*SPG_FY20,0.01);    * FY 2020 State Cost Per Pupil AEA Ed Support;
TS_AEA_SCPP_FY20 = Round(TS_AEA_SCPP_FY19*SPG_FY20,0.01);    * FY 2020 State Cost Per Pupil AEA Teacher Salary;
PD_AEA_SCPP_FY20 = Round(PD_AEA_SCPP_FY19*SPG_FY20,0.01);    * FY 2020 State Cost Per Pupil AEA Professional Development;

/*FY 2021 Cost Per Pupil amounts*/

CPP_FY21 = Round(SCPP_FY20*SPG_FY21,1);	* FY 2021 Cost Per Pupil Amount;
SCPP_FY21 = SCPP_FY20+CPP_FY21;   *FY 2021 State Cost Per Pupil;

SCPP_AEA_FY21 = SCPP_FY21;   *FY 2021 State Cost Per Pupil for AEA;

TS_CPP_FY21 = Round(TS_CPP_FY20*SPG_FY21,0.01); * FY 2021 Cost Per Pupil Amount Teacher Salary;
TS_SCPP_FY21 = TS_SCPP_FY20+TS_CPP_FY21;   *FY 2021 State Cost Per Pupil Teacher Salary;
PD_CPP_FY21 = Round(PD_CPP_FY20*SPG_FY21,0.01); * FY 2021 Cost Per Pupil Amount Professional Development;
PD_SCPP_FY21 = PD_SCPP_FY20+PD_CPP_FY21;   *FY 2021 State Cost Per Pupil Professional Development;
EI_CPP_FY21 = Round(EI_CPP_FY20*SPG_FY21,0.01); * FY 2021 Cost Per Pupil Amount Early Intervention;
EI_SCPP_FY21 = EI_SCPP_FY20+EI_CPP_FY21;   *FY 2021 State Cost Per Pupil Early Intervention;
TL_CPP_FY21 = Round(TL_CPP_FY20*SPG_FY21,0.01); * FY 2021 Cost Per Pupil Amount Teacher Leadership;
TL_SCPP_FY21 = TL_SCPP_FY20+TL_CPP_FY21;   *FY 2021 State Cost Per Pupil Teacher Leadership;

AEA_SPED_SCPP_FY21 = Round(AEA_SPED_SCPP_FY20*SPG_FY21,0.01); * FY 2021 State Cost Per Pupil AEA Special Education;
AEAMED_SCPP_FY21 = Round(AEAMED_SCPP_FY20*SPG_FY21,0.01);    * FY 2021 State Cost Per Pupil AEA Media;
AEAED_SCPP_FY21 = Round(AEAED_SCPP_FY20*SPG_FY21,0.01);    * FY 2021 State Cost Per Pupil AEA Ed Support;
TS_AEA_SCPP_FY21 = Round(TS_AEA_SCPP_FY20*SPG_FY21,0.01);    * FY 2021 State Cost Per Pupil AEA Teacher Salary;
PD_AEA_SCPP_FY21 = Round(PD_AEA_SCPP_FY20*SPG_FY21,0.01);    * FY 2021 State Cost Per Pupil AEA Professional Development;

/*FY 2022 Cost Per Pupil amounts*/

CPP_FY22 = Round(SCPP_FY21*SPG_FY22,1);	* FY 2022 Cost Per Pupil Amount;
SCPP_FY22 = SCPP_FY21+CPP_FY22;   *FY 2022 State Cost Per Pupil;

SCPP_AEA_FY22 = SCPP_FY22;   *FY 2022 State Cost Per Pupil for AEA;

TS_CPP_FY22 = Round(TS_CPP_FY21*SPG_FY22,0.01); * FY 2022 Cost Per Pupil Amount Teacher Salary;
TS_SCPP_FY22 = TS_SCPP_FY21+TS_CPP_FY22;   *FY 2022 State Cost Per Pupil Teacher Salary;
PD_CPP_FY22 = Round(PD_CPP_FY21*SPG_FY22,0.01); * FY 2022 Cost Per Pupil Amount Professional Development;
PD_SCPP_FY22 = PD_SCPP_FY21+PD_CPP_FY22;   *FY 2022 State Cost Per Pupil Professional Development;
EI_CPP_FY22 = Round(EI_CPP_FY21*SPG_FY22,0.01); * FY 2022 Cost Per Pupil Amount Early Intervention;
EI_SCPP_FY22 = EI_SCPP_FY21+EI_CPP_FY22;   *FY 2022 State Cost Per Pupil Early Intervention;
TL_CPP_FY22 = Round(TL_CPP_FY21*SPG_FY22,0.01); * FY 2022 Cost Per Pupil Amount Teacher Leadership;
TL_SCPP_FY22 = TL_SCPP_FY21+TL_CPP_FY22;   *FY 2022 State Cost Per Pupil Teacher Leadership;

AEA_SPED_SCPP_FY22 = Round(AEA_SPED_SCPP_FY21*SPG_FY22,0.01); * FY 2022 State Cost Per Pupil AEA Special Education;
AEAMED_SCPP_FY22 = Round(AEAMED_SCPP_FY21*SPG_FY22,0.01);    * FY 2022 State Cost Per Pupil AEA Media;
AEAED_SCPP_FY22 = Round(AEAED_SCPP_FY21*SPG_FY22,0.01);    * FY 2022 State Cost Per Pupil AEA Ed Support;
TS_AEA_SCPP_FY22 = Round(TS_AEA_SCPP_FY21*SPG_FY22,0.01);    * FY 2022 State Cost Per Pupil AEA Teacher Salary;
PD_AEA_SCPP_FY22 = Round(PD_AEA_SCPP_FY21*SPG_FY22,0.01);    * FY 2022 State Cost Per Pupil AEA Professional Development;


/*array SPG{7} SPG_FY16-SPG_FY22;*/

array L101{7} L101_FY16-L101_FY22;
array EnrollProjection{7} EnrollProjection_FY16-EnrollProjection_FY22;

array L201{7} L201_FY16-L201_FY22;
array L202{7} L202_FY16-L202_FY22;
array CPP{7}  CPP_FY16-CPP_FY22;
array L203{7} L203_FY16-L203_FY22;
array L204{7} L204_FY16-L204_FY22;
array L205{7} L205_FY16-L205_FY22;
array TS_CPP{7}  TS_CPP_FY16-TS_CPP_FY22;
array L206{7} L206_FY16-L206_FY22;
array L207{7} L207_FY16-L207_FY22;
array L208{7} L208_FY16-L208_FY22;
array PD_CPP{7}  PD_CPP_FY16-PD_CPP_FY22;
array L209{7} L209_FY16-L209_FY22;
array L210{7} L210_FY16-L210_FY22;
array L211{7} L211_FY16-L211_FY22;
array EI_CPP{7}  EI_CPP_FY16-EI_CPP_FY22;
array L212{7} L212_FY16-L212_FY22;
array L213{7} L213_FY16-L213_FY22;
array L214{7} L214_FY16-L214_FY22;
array TL_CPP{7}  TL_CPP_FY16-TL_CPP_FY22;
array L215{7} L215_FY16-L215_FY22;



* BUDGET ENROLLMENT;							* BUDGET ENROLLMENT;
L101{i}=EnrollProjection{i};		*Forecast Change				* Line 1.1 - Budget Enrollment (Oct 2014 Budget Enrollment);
/*L102{i}=	0;						    *Forecast Change                * Line 1.2 - Audited Change in Oct 2013 Certified Enrollment ;*/
/*L103{i}=	0;						    *Forecast Change									* Line 1.3 - FY15 Regular Program District Cost Per Pupil (Line 2.3 - FY15 Aid &amp;amp; Levy);*/
/*L104{i}=	0;						    *Forecast Change									* Line 1.4 - Enrollment Audit Adjustment;*/
/*L105{i}=	0;						    *Forecast Change			* Line 1.5 - FY15 Regular Program Foundation Cost Per Pupil;*/
/*L106{i}=	0;						    *Forecast Change							* Line 1.6 - Audited Change in Oct 2013 Certified Enrollment (Line 1.2)   ;*/
/*L107{i}=	0;						    *Forecast Change									* Line 1.7 - Enrollment Audit Adjustment - State Aid Portion;*/
* COST PER PUPIL AMOUNTS;						* COST PER PUPIL AMOUNTS;
L201{i}=	L203{i-1};									* Line 2.1 - FY16 Regular Program District Cost Per Pupil (Line 2.3);
L202{i}=		CPP{i};			* Line 2.2 - FY17 Regular Program Supplemental State Aid Amount Per Pupil CHANGE IN FORCAST YEAR!!!!!!!!!!!!!!!;
L203{i}=		Sum(L201{i},L202{i});					* Line 2.3 - FY17 Regular Program District Cost Per Pupil   ;
L204{i}=	L206{i-1};						* Line 2.4 - FY16 Teacher Salary Supplement Cost Per Pupil (Line 2.6 - FY16 Aid &amp;amp; Levy)  ;
L205{i}=		TS_CPP{i};		* Line 2.5 - FY17 Teacher Salary Supplement Supplemental State Aid Amount Per Pupil CHANGE IN FORCAST YEAR!!!!!!!!!!!!!!!;
L206{i}=		Sum(L204{i},L205{i});					* Line 2.6 - FY17 Teacher Salary Supplement Cost Per Pupil   ;
L207{i}=	L209{i-1};						* Line 2.7 - FY16 Professional Dev Suppl Cost Per Pupil (Line 2.9 - FY16 Aid &amp;amp; Levy)    ;
L208{i}=		PD_CPP{i};		* Line 2.8 - FY17 Professional Development Supplement Supplemental State Aid Amt Per Pupil CHANGE IN FORCAST YEAR!!!!!!!!!!!!!!!;
L209{i}=		Sum(L207{i},L208{i});					* Line 2.9 - FY17 Professional Development Supplement Cost Per Pupil   ;
L210{i}=	L212{i-1};						* Line 2.10 - FY16 Early Intervention Suppl Cost Per Pupil (Line 2.12 - FY16 Aid &amp;amp; Levy)    ;
L211{i}=		EI_CPP{i};		* Line 2.11 - FY17 Early Intervention Supplement Supplemental State Aid Amount Per Pupil CHANGE IN FORCAST YEAR!!!!!!!!!!!!!!!;
L212{i}=		Sum(L210{i},L211{i});					* Line 2.12 - FY17 Early Intervention Supplement Cost Per Pupil   ;
L213{i}=	L215{i-1};						* Line 2.13 - FY16 Teacher Leadership Supplement Cost Per Pupil;
L214{i}=		TL_CPP{i};		* Line 2.14 - FY17 Teacher Leadership Supplement Supplemental State Aid Amount Per Pupil CHANGE IN FORCAST YEAR!!!!!!!!!!!!!!!;
L215{i}=		Sum(L213{i},L214{i});					* Line 2.15 - FY17 Teacher Leadership Supplement Cost Per Pupil   ;

do i=2 to 7; /* as 1 does not have previous */
    
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 15:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Macro-Loop-for-Forecast-Years/m-p/228060#M5534</guid>
      <dc:creator>Parker1</dc:creator>
      <dc:date>2015-10-01T15:01:35Z</dc:date>
    </item>
  </channel>
</rss>

