s******r 发帖数: 1524 | 1 I am using proc sql to count distinct value. However it sounds proc sql
count null value as well. Anybody has the idea how to handle it or it is
only a bug of SAS?
Thanks, |
p********a 发帖数: 5352 | 2 It doesn't count null value |
s******r 发帖数: 1524 | 3 So I wonder it is a bug of my SAS. It did count null value as well. I set
the value to '00'X. Maybe it is not a good way to assign null value?
Actually I run following code first
count(distinct case when A in ('01',,'02') then B else null end) as ...
However SAS took null as a variable instead value. So I used following code
instead
count(distinct case when A in ('01',,'02') then B else '00'x end)
The code works on oralce database but not on SAS. :(
【在 p********a 的大作中提到】 : It doesn't count null value
|
p********a 发帖数: 5352 | 4 SAS/SQL NE SQL
SAS/SQL doesn't recognize NULL or '00'x
It is taken as a value |
p********a 发帖数: 5352 | 5 just replace '00'x as '', you will be fine |
s******r 发帖数: 1524 | 6 '' works but I have to transfer variable A to character. :(
Thanks,
【在 p********a 的大作中提到】 : just replace '00'x as '', you will be fine
|
o****o 发帖数: 8077 | 7 can u use
case (when else) end
statement?
【在 s******r 的大作中提到】 : I am using proc sql to count distinct value. However it sounds proc sql : count null value as well. Anybody has the idea how to handle it or it is : only a bug of SAS? : Thanks,
|
s*r 发帖数: 2757 | 8 why not set null values as missing |