1 proc sql;
2     select date,coalesce(city,1),wangnei from mysas.mms;
3 quit;

coalesce()函数可以判断字段的缺失值并用指定的值来代替,注意字段值类型需要和指定的值类型保持一致。

或者

1 proc sql;
2     select date,wangnei,
3         case
4             when city is missing then 1
5             else city
6         end as city
7     from mysas.mms;
8 quit;

也可以实现相同的功能。

 

相关文章:

  • 2021-11-02
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-05-24
相关资源
相似解决方案