DATA Step, Macro, Functions and more

Error message: One or more variables are missing or freq or weight is zero on every observation

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

Error message: One or more variables are missing or freq or weight is zero on every observation

[ Edited ]

 

Data TukeysAnalysisSexualDimorphism;
input Group $ Nuchal Mastoid Orbit Glabella Mental SN VA SpC Ibrr;
cards;
TBM	4	3	4	2	4	5	3	3	2
TBM	4	4	3	3	4	4	3	3	3
TBF	1	1	3	1	2	1	1	1	1
TBM	5	4	4	2	3	4	3	3	3
TBF	2	2	2	1	3	2	1	2	1
TBM	4	3	4	3	4	3	3	3	3
TBF	4	3	1	2	2	2	1	1	1
TBM	3	3	4	3	3	4	3	3	3
TBM	4	5	4	3	3	3	3	3	3
TBF	2	2	1	1	2	3	1	2	2
TBF	4	1	2	2	2	1	1	2	1
TBM	4	3	3	3	5	5	3	3	3
TBM	3	3	4	3	3	4	3	3	3
TBF	1	1	1	1	1	4	1	2	2
TBM	4	5	3	4	4	3	3	3	3
TBF	3	2	3	2	2	4	1	1	1
TBF	2	2	2	1	1	3	1	2	1
TBM	4	5	5	3	4	4	3	3	3
TBF	3	1	2	1	2	2	1	1	1
TBM	4	4	3	5	3	5	3	3	3
TBF	3	2	5	1	2	1	1	1	2
TBM	3	4	4	4	4	3	3	3	3
TBM	4	5	5	3	4	4	3	3	3
TBM	3	2	3	2	3	4	3	3	3
TBM	4	4	4	3	3	4	3	3	3
TBM	3	3	3	3	2	5	3	3	3
TBF	3	2	1	2	2	3	1	1	2
TBM	5	4	4	4	3	3	3	3	3
TBM	4	4	5	4	4	5	3	3	3
TBM	4	4	3	3	4	4	3	3	3
TBF	3	1	2	1	2	1	1	1	1
TBF	3	1	3	2	3	1	1	1	1
TBM	3	2	5	3	4	4	3	3	3
TBF	2	2	3	1	1	1	1	2	1
TBM	3	3	2	3	4	2	3	3	3
TBM	4	5	4	3	4	4	3	3	3
TBF	2	2	1	1	1	2	1	1	1
TBF	3	2	2	1	1	2	2	1	1
TBF	3	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3
NAM	4	5	3	5	4	4	3	3	3
NAM	5	4	4	3	4	5	3	3	3
NAF	3	1	2	1	1	1	.	.	.
NAM	4	4	4	4	3	5	3	3	3
NAF	2	2	3	2	2	2	.	.	1
NAF	3	3	3	2	2	3	1	1	2
NAF	1	2	2	2	3	1	1	1	1
NAM	3	3	4	4	3	4	3	3	3
NAF	2	2	4	3	3	1	1	1	1
NAM	3	3	3	3	4	5	.	.	.
NAF	3	1	2	1	1	1	1	1	1
NAF	1	1	3	2	2	3	1	1	1
NAF	2	1	4	1	1	1	.	.	.
NAF	1	1	.	1	2	2	1	1	1
NAM	3	4	3	3	4	5	3	3	3
NAM	3	.	.	3	1	5	3	3	3
NAM	3	4	5	4	4	4	.	.	.
NAM	1	2	3	1	3	5	3	3	3
NAM	3	2	5	4	4	5	3	3	3
NAM	4	2	2	4	2	5	3	3	3
NAM	3	3	4	3	3	5	3	3	3
NAM	4	4	3	4	3	3	3	3	3
NAM	4	3	4	5	5	4	3	3	3
NAM	4	4	5	5	4	5	3	3	3
NAM	4	5	.	3	4	4	3	3	3
NAM	3	3	4	4	3	5	3	3	3
;
proc glm;
class Group;
model Nuchal = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Mastoid = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Orbit = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Glabella = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Mental = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model SN = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model VA = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model SpC = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Ibrr = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;

Getting errors and can't quite figure out what is missing in my code. it has to be something really simple! Any help appreciated!


Accepted Solutions
Solution
‎01-25-2018 12:02 PM
Contributor
Posts: 30

Re: Error message: One or more variables are missing or freq or weight is zero on every observation

Use Below code ,it will work.  There is  some problem with your data in datacards. I  have converted CRLF to LF and changed the TAB  to spaces. It did work with out any errors.. You can use any text Edit tool to do this...

 

 

Data TukeysAnalysisSexualDimorphism;
input Group $ Nuchal Mastoid Orbit Glabella Mental SN VA SpC Ibrr;
cards;
TBM 4 3 4 2 4 5 3 3 2
TBM 4 4 3 3 4 4 3 3 3
TBF 1 1 3 1 2 1 1 1 1
TBM 5 4 4 2 3 4 3 3 3
TBF 2 2 2 1 3 2 1 2 1
TBM 4 3 4 3 4 3 3 3 3
TBF 4 3 1 2 2 2 1 1 1
TBM 3 3 4 3 3 4 3 3 3
TBM 4 5 4 3 3 3 3 3 3
TBF 2 2 1 1 2 3 1 2 2
TBF 4 1 2 2 2 1 1 2 1
TBM 4 3 3 3 5 5 3 3 3
TBM 3 3 4 3 3 4 3 3 3
TBF 1 1 1 1 1 4 1 2 2
TBM 4 5 3 4 4 3 3 3 3
TBF 3 2 3 2 2 4 1 1 1
TBF 2 2 2 1 1 3 1 2 1
TBM 4 5 5 3 4 4 3 3 3
TBF 3 1 2 1 2 2 1 1 1
TBM 4 4 3 5 3 5 3 3 3
TBF 3 2 5 1 2 1 1 1 2
TBM 3 4 4 4 4 3 3 3 3
TBM 4 5 5 3 4 4 3 3 3
TBM 3 2 3 2 3 4 3 3 3
TBM 4 4 4 3 3 4 3 3 3
TBM 3 3 3 3 2 5 3 3 3
TBF 3 2 1 2 2 3 1 1 2
TBM 5 4 4 4 3 3 3 3 3
TBM 4 4 5 4 4 5 3 3 3
TBM 4 4 3 3 4 4 3 3 3
TBF 3 1 2 1 2 1 1 1 1
TBF 3 1 3 2 3 1 1 1 1
TBM 3 2 5 3 4 4 3 3 3
TBF 2 2 3 1 1 1 1 2 1
TBM 3 3 2 3 4 2 3 3 3
TBM 4 5 4 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2 3 3 3 3 3
NAM 5 . 2 4 3 5 3 3 3
NAM 4 3 5 3 . 4 3 3 3
NAM 4 5 3 5 4 4 3 3 3
NAM 5 4 4 3 4 5 3 3 3
NAF 3 1 2 1 1 1 . . .
NAM 4 4 4 4 3 5 3 3 3
NAF 2 2 3 2 2 2 . . 1
NAF 3 3 3 2 2 3 1 1 2
NAF 1 2 2 2 3 1 1 1 1
NAM 3 3 4 4 3 4 3 3 3
NAF 2 2 4 3 3 1 1 1 1
NAM 3 3 3 3 4 5 . . .
NAF 3 1 2 1 1 1 1 1 1
NAF 1 1 3 2 2 3 1 1 1
NAF 2 1 4 1 1 1 . . .
NAF 1 1 . 1 2 2 1 1 1
NAM 3 4 3 3 4 5 3 3 3
NAM 3 . . 3 1 5 3 3 3
NAM 3 4 5 4 4 4 . . .
NAM 1 2 3 1 3 5 3 3 3
NAM 3 2 5 4 4 5 3 3 3
NAM 4 2 2 4 2 5 3 3 3
NAM 3 3 4 3 3 5 3 3 3
NAM 4 4 3 4 3 3 3 3 3
NAM 4 3 4 5 5 4 3 3 3
NAM 4 4 5 5 4 5 3 3 3
NAM 4 5 . 3 4 4 3 3 3
NAM 3 3 4 4 3 5 3 3 3
;
proc glm;
class Group;
model Nuchal = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Mastoid = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Orbit = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Glabella = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Mental = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model SN = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model VA = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model SpC = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Ibrr = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;

View solution in original post


All Replies
Super User
Posts: 10,623

Re: Error message

Posted in reply to waxenbaum

Please do not post SAS code in MS Office documents. Many of us won't or can't open them for security reasons. Post code according to https://communities.sas.com/t5/help/faqpage/faq-category-id/posting?nobounce. Use the {i} button to post logs.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
PROC Star
Posts: 1,410

Re: Error message

Posted in reply to waxenbaum

Please post your log? I just ran your program and did not get any errors? 

 

You might want to add a QUIT statement after the last PROC GLM though

Occasional Contributor
Posts: 10

Re: Error message

I've never used a quit statement. literally just an extra line with quit;

Super User
Super User
Posts: 9,866

Re: Error message

Posted in reply to waxenbaum

What errors?  Post a log, unfortunately we can't see your screen to work out what is wrong.

Occasional Contributor
Posts: 10

Re: Error message

I just updated the post, but the error is:

One or more variables are missing or freq or weight is zero on every observation

 

It comes up multiple times but I can't find the error in the data. I've looked numerous times, so I assume it's a coding error somewhere.

Super User
Posts: 10,623

Re: Error message

[ Edited ]
Posted in reply to waxenbaum

Your data step uses tabs as delimiter, do this:

Data TukeysAnalysisSexualDimorphism;
infile cards dlm='09'x;
input Group $ Nuchal Mastoid Orbit Glabella Mental SN VA SpC Ibrr;
cards;

Without the infile statement that sets the correct delimiter, you get data ERRORs (NOTE: Invalid data for .....) and subsequent problems in proc glm. Such NOTEs must never be tolerated.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 10

Re: Error message

Posted in reply to KurtBremser
Thank you!!! Worked perfectly!!


Super User
Posts: 13,950

Re: Error message: One or more variables are missing or freq or weight is zero on every observation

Posted in reply to waxenbaum

waxenbaum wrote:

 

Getting errors and can't quite figure out what is missing in my code. it has to be something really simple! Any help appreciated!


With your example data and code as pasted I cannot replicate the error.

 

I suggest running proc freq on your actual data set for the variables used in your models for the procedure calls that get the error looking for the number of missing values.

Example code:

proc freq data=TukeysAnalysisSexualDimorphism;

   tables group*Nuchal /list missing;

run;

 

BTW, You will find eventually that habitually leaving off the DATA= part of procedure calls will cause problems. If you had created an output data set from any of the Proc GLM calls the _last_ data set would cause this issue as the input data set was no longer the one you expected.

 

 

Solution
‎01-25-2018 12:02 PM
Contributor
Posts: 30

Re: Error message: One or more variables are missing or freq or weight is zero on every observation

Use Below code ,it will work.  There is  some problem with your data in datacards. I  have converted CRLF to LF and changed the TAB  to spaces. It did work with out any errors.. You can use any text Edit tool to do this...

 

 

Data TukeysAnalysisSexualDimorphism;
input Group $ Nuchal Mastoid Orbit Glabella Mental SN VA SpC Ibrr;
cards;
TBM 4 3 4 2 4 5 3 3 2
TBM 4 4 3 3 4 4 3 3 3
TBF 1 1 3 1 2 1 1 1 1
TBM 5 4 4 2 3 4 3 3 3
TBF 2 2 2 1 3 2 1 2 1
TBM 4 3 4 3 4 3 3 3 3
TBF 4 3 1 2 2 2 1 1 1
TBM 3 3 4 3 3 4 3 3 3
TBM 4 5 4 3 3 3 3 3 3
TBF 2 2 1 1 2 3 1 2 2
TBF 4 1 2 2 2 1 1 2 1
TBM 4 3 3 3 5 5 3 3 3
TBM 3 3 4 3 3 4 3 3 3
TBF 1 1 1 1 1 4 1 2 2
TBM 4 5 3 4 4 3 3 3 3
TBF 3 2 3 2 2 4 1 1 1
TBF 2 2 2 1 1 3 1 2 1
TBM 4 5 5 3 4 4 3 3 3
TBF 3 1 2 1 2 2 1 1 1
TBM 4 4 3 5 3 5 3 3 3
TBF 3 2 5 1 2 1 1 1 2
TBM 3 4 4 4 4 3 3 3 3
TBM 4 5 5 3 4 4 3 3 3
TBM 3 2 3 2 3 4 3 3 3
TBM 4 4 4 3 3 4 3 3 3
TBM 3 3 3 3 2 5 3 3 3
TBF 3 2 1 2 2 3 1 1 2
TBM 5 4 4 4 3 3 3 3 3
TBM 4 4 5 4 4 5 3 3 3
TBM 4 4 3 3 4 4 3 3 3
TBF 3 1 2 1 2 1 1 1 1
TB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M 4 3 3 3 3 3 3 3 3
NAF 3 1 2 1 1 1 1 1 1
NAF 3 2 4 1 1 2 1 1 1
NAM 4 4 2 2 3 5 3 3 3
NAM 4 3 3 2 3 3 3 3 3
NAM 5 . 2 4 3 5 3 3 3
NAM 4 3 5 3 . 4 3 3 3
NAM 4 5 3 5 4 4 3 3 3
NAM 5 4 4 3 4 5 3 3 3
NAF 3 1 2 1 1 1 . . .
NAM 4 4 4 4 3 5 3 3 3
NAF 2 2 3 2 2 2 . . 1
NAF 3 3 3 2 2 3 1 1 2
NAF 1 2 2 2 3 1 1 1 1
NAM 3 3 4 4 3 4 3 3 3
NAF 2 2 4 3 3 1 1 1 1
NAM 3 3 3 3 4 5 . . .
NAF 3 1 2 1 1 1 1 1 1
NAF 1 1 3 2 2 3 1 1 1
NAF 2 1 4 1 1 1 . . .
NAF 1 1 . 1 2 2 1 1 1
NAM 3 4 3 3 4 5 3 3 3
NAM 3 . . 3 1 5 3 3 3
NAM 3 4 5 4 4 4 . . .
NAM 1 2 3 1 3 5 3 3 3
NAM 3 2 5 4 4 5 3 3 3
NAM 4 2 2 4 2 5 3 3 3
NAM 3 3 4 3 3 5 3 3 3
NAM 4 4 3 4 3 3 3 3 3
NAM 4 3 4 5 5 4 3 3 3
NAM 4 4 5 5 4 5 3 3 3
NAM 4 5 . 3 4 4 3 3 3
NAM 3 3 4 4 3 5 3 3 3
;
proc glm;
class Group;
model Nuchal = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Mastoid = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Orbit = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Glabella = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Mental = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model SN = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model VA = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model SpC = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;
proc glm;
class Group;
model Ibrr = Group/solution;
lsmeans Group/pdiff adjust=Tukey;
run;

Occasional Contributor
Posts: 10

Re: Error message: One or more variables are missing or freq or weight is zero on every observation

Posted in reply to againreddy
Thank you!!!


☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 10 replies
  • 353 views
  • 0 likes
  • 6 in conversation