Programming the statistical procedures from SAS

Error 22-322 and error ERROR 200-322 with Regression From Excel

Reply
Occasional Contributor
Posts: 6

Error 22-322 and error ERROR 200-322 with Regression From Excel

Hello, I've got some code that I'm doing multiple linear regression on. 

I've got data from an Excel file and that code is okay. It's when I'm referencing the data for the regression that I have problems on.

I know it's with the Datalines code. But I don't know what to do with it. I'm sorry for the bother. Could you please help?

The errors are 

ERROR 22-322: Syntax error, expecting one of the following: ;, CANCEL, PGM.
 
ERROR 200-322: The symbol is not recognized and will be ignored.

 

LibName Perm '/folders/myfolders/';

Proc import DataFile='/folders/myfolders/SimioHours.xlsx'
	Out=perm.SimioHours
	dbms=xlsx replace;
	
Run;

Proc Contents data=perm.SimioHours;
Run;

Proc Print data=perm.SimioHours;
Run;

Data SimioHoursRegression;
Input BrightBox	Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days Standard_Install_Hours Additional_SOW_Hours;
Datalines = '/folders/myfolders/simiohours.sas7bdat'
;

Proc Reg; Model Standard_Install_Hours= BrightBox Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days	Additional_SOW_Hours;
Run;
Super User
Posts: 23,724

Re: Error 22-322 and error ERROR 200-322 with Regression From Excel

Posted in reply to taggerung

Add some comments to your code so we understand what you're trying to accomplish in each step. 

 

The code doesn't make sense, so without knowing what you're trying to do, I can make a guess on how to change it.


You  can find examples at Video.sas.com > How To Tutorials> Analytics U has an example of how to perform a regression analysis. 

 

The problematic portions of your code are below. 

 

The data step doesn't make sense, you don't refer to a SAS data set like that so I"m not sure what you're trying to do with this step at all. 

 

For the regression you don't have a DATA= statement which would tell SAS what data set to use for the regression

 

Data SimioHoursRegression;
Input BrightBox	Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days Standard_Install_Hours Additional_SOW_Hours;
Datalines = '/folders/myfolders/simiohours.sas7bdat'
;

I think your regression should be:

Proc Reg DATA = perm.simiohours;
Model Standard_Install_Hours= BrightBox Service_Panel_Upgrade Number_Inverters Number_Panels Number_Employee_Days	Additional_SOW_Hours;
Run;
Occasional Contributor
Posts: 6

Re: Error 22-322 and error ERROR 200-322 with Regression From Excel

That and getting rid of the Input statement got the same regression and no errors. Thanks a ton!

Ask a Question
Discussion stats
  • 2 replies
  • 161 views
  • 2 likes
  • 2 in conversation