BookmarkSubscribeRSS Feed
hjjijkkl
Pyrite | Level 9

I keep on getting this warning in my log when i do proc tabulate. If I use "missing" in the class statement then the missing value show up on my report. I dont want the missing values on my report to show up. Is there way to ignore the missing values in proc tabulate? Please help!

 

WARNING: A class, frequency, or weight variable is missing on every observation.

1 REPLY 1
ballardw
Super User

You may want to look at the CLASSDATA=dataset option along with EXCLUSIVE. You use that data set to specify the combinations of class variables you want to appear in the data and EXCLUSIVE removes the rest.

 

An example:

data classdataexample;
  sex= 'M';
  do age = 13,14;
     output;
  end;
  sex='F';
  do age= 12, 13;
     output;
  end;
run; 

proc tabulate data=sashelp.class
     classdata=classdataexample exclusive;
     class sex age;
     var height;
     table sex*height*(min mean max),
           age
     ;
run;

The resulting table does show missing values of Height statistics for the age/sex combinations that result but don't match the restricted age/sex combinations for the class variables.

 

You'll want to start with small sets and few variables to build things as when you get lots of elements you may have a hard time predicting all the interactions.

But you may well need to use missing on the class somewhere because of your data contents.

You may have to provide a small example of your data with some of the missing values and what you expect the proc tabulate output to look like. Sometimes your data just won't support some results without modification.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 705 views
  • 2 likes
  • 2 in conversation