BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Orongo
Calcite | Level 5

Hi, I'm a beginner in SAS and have an excercise to read in data and then use the means to print analysis. But I get the error message "Statement is not valid or it is used out of proper order." My data table is [id, kon, lon, atid]

 19     K      7150      50
 26     K     12300     100
 12     K      6400      50
 10     K      5650      50
  9     K     17600     100
 11     K     16200     100
  3     K     12600     100
 16     K     16900     100
 25     K     13700     100
 22     K      9900     100
  6     K      8900      50
  7     K     10700     100
 24     K     13800     100
  8     K     13100     100
 17     K     15400     100
  2     K     14100     100
 18     K     16100     100
  4     K     19700     100
 15     K     11500     100

and the code is

data ekon;
	infile '/folders/myfolders/ekon-win.txt';
	input id kon $ lon atid; 
	run;

proc sort data=ekon; by kon id;	
	proc print data=ekon;
	run;

proc means data=ekon maxdec=0;
	var lon atid;
	class kon;
	title 'Means ekon';
	run;

 

SAS complaints about the line "var lon atid", what am I not seeing?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Orongo
Calcite | Level 5

Glad to read that I haven't gotten blind Smiley Very Happy

 

I shifted arounf the code in the program and it now works! Thanks for the help Merry Xmas!

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi Orongo,

Good news: There is no syntax error in the code you've posted.

I would simply resubmit this code. If the error still occurs, please post the log.

Orongo
Calcite | Level 5

Glad to read that I haven't gotten blind Smiley Very Happy

 

I shifted arounf the code in the program and it now works! Thanks for the help Merry Xmas!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 4059 views
  • 0 likes
  • 2 in conversation