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

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 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
  • 4092 views
  • 0 likes
  • 2 in conversation