BookmarkSubscribeRSS Feed
Astounding
PROC Star

Well, the syntax errors are gone.  It becomes how to get from where you are now to what you need.  There may be more than one way.

 

Maybe you should generate one huge data set with all the variables in it, and then separate out the variables into subsets.

 

Maybe you should add another macro loop outside of all the current looping.  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.

 

It's really a question that you have to address.  Compare what you have now to what you need.  You're the one that can summarize what else needs to happen at this point.

Parker1
Fluorite | Level 6

I will take your suggestion and generate one data set with all the variables in it.  That means I go back to using arrays?  I have been experimenting with the arrays but get the following errors that my variables have been defined and not declared as an array.

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 & 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 & 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 & 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 & 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;

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 16 replies
  • 3542 views
  • 1 like
  • 4 in conversation