BookmarkSubscribeRSS Feed
LaLa1
Calcite | Level 5

I am having problem to run SAS codes using SAS studio (university). The weird thing is that when I open the same file and run using SAS program in the computer at the University, it works. So basically some files open some not. The example that I am using:

data Q1;
input day type $ lightReading;
datalines;
1 M 4
1 A 4.8
1 K 5
1 L 4.6
2 M 4.8
2 A 5
2 K 5.2
2 L 4.6
3 M 4
3 A 4.8
3 K 5.6
3 L 5
;
*proc glm data=Q1;
class day type;
model lightreading= day type;
run;
proc anova data=Q1;
class day type;
model lightreading= day type;
run;
 

***The error that gives me is that:

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

3 REPLIES 3
andreas_lds
Jade | Level 19

I don't think that the code won't give any errors when executed in different environments, because the * in the line

*proc glm data=Q1;

starts a comment that ends at the first semicolon. So the compiler sees a class-statement outside any procedure allowing such statement and issues a "statement is not valid ..." error. Removing the * should solve the problem.

 

For future posts, please use the running man icon to post code and for debugging programs it is almost always necessary to see the full log, not just the error message.

LaLa1
Calcite | Level 5

The code with"*" was only an example, in order to run I remove the * and it doesn't work.

Reeza
Super User

Verify that your input file is read in correctly. Different OS have different characters that denote end of the line when reading in data. SAS UE is using a Unix system whereas your work/school is likely Windows. 

 

So besides the * and commenting out the PROC GLM statement, double check that your data is being imported correctly in each system. There's nothing in your code that should run differently otherwise.

 

Review SAS CI360 now.png

 

Want to review SAS CI360? G2 is offering a gift card or charitable donation for each accepted review. Use this link to opt out of receiving anything of value for your review.

 

 

 

 

SAS Customer Intelligence 360

Get started with CI 360

Review CI 360 Release Notes

Open a Technical Support case

Suggest software enhancements

Listen to the Reimagine Marketing podcast

Assess your marketing efforts with a free tool

 

Training Resources

SAS Customer Intelligence Learning Subscription (login required)

Access free tutorials

Refer to documentation

Latest hot fixes

Compatibility notice re: SAS 9.4M8 (TS1M8) or later

 

 

How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Review SAS CI360 now.png

 

Want to review SAS CI360? G2 is offering a gift card or charitable donation for each accepted review. Use this link to opt out of receiving anything of value for your review.

 

 

 

 

SAS Customer Intelligence 360

Get started with CI 360

Review CI 360 Release Notes

Open a Technical Support case

Suggest software enhancements

Listen to the Reimagine Marketing podcast

Assess your marketing efforts with a free tool

 

Training Resources

SAS Customer Intelligence Learning Subscription (login required)

Access free tutorials

Refer to documentation

Latest hot fixes

Compatibility notice re: SAS 9.4M8 (TS1M8) or later

 

 

Discussion stats
  • 3 replies
  • 780 views
  • 2 likes
  • 3 in conversation