BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
abudyak
Calcite | Level 5
data snowfall;
	input month season @;
	cards;
	12	32.5	12	04.4	12	23.9	12	27.3	12	32.3	12	25.6	12	42.8	12	22.1
	1	40.0	1	27.4	1	06.6	1	60.5	1	15.7	1	22.2	1	53.0	1	25.1
	2	26.3	2	33.0	2	25.4	2	43.8	2	34.6	2	16.8	2	14.8	2	15.2
	3	32.1	3	06.8	3	35.6	3	37.4	3	19.9	3	37.2	3	13.3	3	70.4
	;
	
	proc glm;
		class month;
		model season=month/p;

means month/hovtest=bartlett; output out=snowfall1 predicted=ypred residual=res; run;

 I keep getting the error "ERROR: One or more variables are missing or freq or weight is zero on every observation." And I am not sure why.

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

I tested the below and it works for me

 

data snowfall;
input month season @@;
cards;
12 32.5 12 04.4 12 23.9 12 27.3 12 32.3 12 25.6 12 42.8 12 22.1
1 40.0 1 27.4 1 06.6 1 60.5 1 15.7 1 22.2 1 53.0 1 25.1
2 26.3 2 33.0 2 25.4 2 43.8 2 34.6 2 16.8 2 14.8 2 15.2
3 32.1 3 06.8 3 35.6 3 37.4 3 19.9 3 37.2 3 13.3 3 70.4
;

proc glm;
class month;
model season=month/p;
means month/hovtest=bartlett;
output out=snowfall1 predicted=ypred residual=res;
run;
quit;

View solution in original post

6 REPLIES 6
Reeza
Super User

Check your input data, snowfall. It does't read in correctly so you only get 4 records. 

Add an extra @ so you have a double @@ on your input statement. 

 


@abudyak wrote:
data snowfall;
	input month season @;
	cards;
	12	32.5	12	04.4	12	23.9	12	27.3	12	32.3	12	25.6	12	42.8	12	22.1
	1	40.0	1	27.4	1	06.6	1	60.5	1	15.7	1	22.2	1	53.0	1	25.1
	2	26.3	2	33.0	2	25.4	2	43.8	2	34.6	2	16.8	2	14.8	2	15.2
	3	32.1	3	06.8	3	35.6	3	37.4	3	19.9	3	37.2	3	13.3	3	70.4
	;
	
	proc glm;
		class month;
		model season=month/p;

means month/hovtest=bartlett; output out=snowfall1 predicted=ypred residual=res; run;

 I keep getting the error "ERROR: One or more variables are missing or freq or weight is zero on every observation." And I am not sure why.


 

novinosrin
Tourmaline | Level 20

Hi @abudyak  try 

 

data snowfall;
	input month season @@;
	cards;
	12	32.5	12	04.4	12	23.9	12	27.3	12	32.3	12	25.6	12	42.8	12	22.1
	1	40.0	1	27.4	1	06.6	1	60.5	1	15.7	1	22.2	1	53.0	1	25.1
	2	26.3	2	33.0	2	25.4	2	43.8	2	34.6	2	16.8	2	14.8	2	15.2
	3	32.1	3	06.8	3	35.6	3	37.4	3	19.9	3	37.2	3	13.3	3	70.4
	;
	
	proc glm;
		class month;
		model season=month/p;
		means month/hovtest=bartlett;
		output out=snowfall1 predicted=ypred residual=res;
	run;
	quit;
novinosrin
Tourmaline | Level 20

I tested the below and it works for me

 

data snowfall;
input month season @@;
cards;
12 32.5 12 04.4 12 23.9 12 27.3 12 32.3 12 25.6 12 42.8 12 22.1
1 40.0 1 27.4 1 06.6 1 60.5 1 15.7 1 22.2 1 53.0 1 25.1
2 26.3 2 33.0 2 25.4 2 43.8 2 34.6 2 16.8 2 14.8 2 15.2
3 32.1 3 06.8 3 35.6 3 37.4 3 19.9 3 37.2 3 13.3 3 70.4
;

proc glm;
class month;
model season=month/p;
means month/hovtest=bartlett;
output out=snowfall1 predicted=ypred residual=res;
run;
quit;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 3959 views
  • 0 likes
  • 3 in conversation