| Date: | Tue, 18 Jun 1996 16:26:56 EST |
| Reply-To: | ANDY_YUAN@SMTPLINK.MSSM.EDU |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | Andy Yuan <ANDY_YUAN@SMTPLINK.MSSM.EDU> |
| Subject: | Is this a bug??? |
|---|
Hi, folks, I find something interesting in proc freq:
/** code **/
DATA A;
INPUT ID MONTH $ CENTER $ Q1;
CARDS;
2655 96-04 ONCO 1
6349 96-04 ONCO 1
9853 96-04 ONCO 1
7602 96-04 ONCO .
2646 96-04 ONCO .
0789 96-04 ONCO 1
9339 96-04 ONCO 1
9734 96-04 ONCO .
9236 96-04 ONCO .
9756 96-04 ONCO 1
4059 96-04 ONCO .
0431 96-04 ONCO .
1577 96-04 ONCO 1
6186 96-04 ONCO 1
6699 96-04 ONCO 1
7391 96-04 ONCO 1
7857 96-04 ONCO .
8618 96-04 ONCO .
9511 96-04 ONCO 1
0111 96-04 ONCO .
;
RUN;
PROC FREQ DATA=A; TABLES Q1/OUT=Q1; title 'DATA A'; RUN; PROC PRINT
DATA=Q1; TITLE 'DATA Q1'; RUN;
DATA TEST1; SET Q1; IF PERCENT EQ 100; RUN; RUN; DATA TEST2; SET Q1;
IF PERCENT GT 100; RUN;
PROC PRINT; FORMAT PERCENT 20.16; title 'data test2'; RUN;
/***OUTPUT***/
DATA A 09:58 Tuesday, June 18, 1996
Cumulative Cumulative
Q1 Frequency Percent Frequency Percent
------------------------------------------------
1 11 100.0 11 100.0
Frequency Missing = 9
DATA Q1 09:58 Tuesday, June 18, 1996
OBS Q1 COUNT PERCENT
1 . 9 .
2 1 11 100
data test2 09:58 Tuesday, June 18, 1996
OBS Q1 COUNT PERCENT
1 1 11 100.0000000000000000
The problem here is: Although the percent in data Q1 is exactly 100
(as it should be), the dataset test1 can not output anycase. The
dataset test2 has one case with count 11 and percent 100 instead.(Note
that in test2 I use subsetting statement 'if percent GT 100' ) .
When I try to print it, however, even with format 20.16, I still get
all 0's after decimal point.
Another interesting thing is if the count number were not 11, 'if
percent EQ 100' works well in dataset test1.
Is is a bug in SAS? or someone can give me other explaination?
TIA
Andy
|