Somehow you have assigned a format that none of the resulting values will display with.
Consider this small program that writes the value of the variable X to the results with 5 different formats:
data example;
x=12345;
file print;
put '5 display columns' x= best5.;
put '4 display columns' x= best4.;
put '3 display columns' x= best3.;
put '2 display columns' x= best2.;
put '1 display columns' x= best1.;
run;
Which generates output like:
5 display columns x=12345
4 display columns x=12E3
3 display columns x=1E4
2 display columns x=**
1 display columns x=*
You can see that when the value is longer than the number of columns allotted by the format that the BEST format shifts to exponential notation to try to fit the value but when the number of allowed digits is down to 2 or 1 it only displays the * because there is not valid way to show the number. The behavior will change depending on the format actually assigned.
You could either assign a different format in the proc summary step adding something like :
format no_deaths f8.;
which would allow displaying values up to 8 digits (or use a wider format if needed), change the format in the data set Out2, or assign a different format when using the set. The table viewer you are uses the default assigned format which seems likely to be a 1 width format of some sort
See what this shows:
Proc print data=out2 noobs label;
format no_deaths best16.;
run;
The data set has the value, you just don't see it because of the format. The proc print should show it.
@SASnovice23 wrote:
I have a numeric column which records the number of deaths per year by gender. In order to calculate the total number of deaths per gender, I used the following code:
PROC SUMMARY DATA=DATA1 NWAY;
VAR no_deaths;
CLASS GENDER_CODE;
OUTPUT OUT=OUT2 (DROP=_TYPE_) SUM=;
RUN;
and this is what I get: a * is displayed instead of displaying a numeric value. What might be the issue? I also tried using query builder > computed columns, but the same problem persists.
