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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 5177 views
  • 0 likes
  • 3 in conversation