BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

The Proc Summary shown below is giving a missing value.(There should not be any actually).

PROC SUMMARY DATA=HMOPROD;

BY PRODUCT GENDER AGEX GRP;

VAR  ---Varlistnames---;

OUTPUT OUT=x sum=;

run;

Here there are three products

two genders M F

agex is

18-44

45-54

55-64

65-75

There are 13 grps 1 to 13.

I'm getting a missing value for female 65-75 for each product.Why ?

5 REPLIES 5
SASPhile
Quartz | Level 8

I'm getting a missing value for female and male  65-75 for each product.Why ?

data_null__
Jade | Level 19

You probably want the NWAY option.

After reading the other reply and paying more attention I see that NWAY will have no effect as you did not use CLASS.

SUMMARY without CLASS is like a day without sunshine. :smileymischief:

Message was edited by: data _null_

Astounding
PROC Star

There are two possiilities, both easy for you to check.

First, it is possible that the program you posted is different than the one you actually ran.  For example, if you were to use a CLASS statement instead of a BY statement you would get missing values in the output.  There are other less common differences in the program that could cause this to happen, such as using a preloaded format.  But that's one general category:  Is this exactly the program that you ran?  (The names of the variables in the VAR statement do not matter.)

Second, it is possible that your data contains missing values.  Check again!  If your program is exactly what you posted, and if PRODUCT is missing on some observations in the output data set, then PRODUCT does take on missing values within the incoming data.  (There are obscure variations on this theme, such as running the program first and then changing the data to remove the missing values.)

Good luck.

Astounding
PROC Star

I guess it's also possible that PRODUCT has a format connected with it, that would cause a nonmissing value to print as a blank.  That's a stretch, but it is possible.

Ksharp
Super User

I also notice a problem in your code.

Do you have more than two variables needed to analysis ?

OUTPUT OUT=x sum= /autoname ;

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
  • 5 replies
  • 2153 views
  • 0 likes
  • 4 in conversation