BookmarkSubscribeRSS Feed

欠損値を0に置き換える

Started ‎03-03-2019 by
Modified ‎03-03-2019 by
Views 1,245

質問

任意の数値変数の値が欠損値のときに、0に置き換えるにはどうすれば良いですか。

 

回答

欠損値は、プログラムでは「.(ピリオド)」で表せます。

 

次の例は、a1が欠損値のとき0に置き換えるサンプルプログラムです。

 

<サンプルプログラム>

data a;
   set a; 
   if a1 = . then  a1 = 0; 
run;

 

Version history
Last update:
‎03-03-2019 09:00 PM
Updated by:
Contributors

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Article Labels
Article Tags

SAS Support Communitiesのユーザーガイドライン


コミュニティの基本的なガイドラインについてご説明します。まずは、こちらをご参照ください。

詳細を読む

 

SAS Support CommunitiesのFAQ


SAS Support CommunitiesのFAQはヘルプに記載されています。参照方法は、こちらからご確認ください。

詳細を読む

 

質問や意見の投稿と返信方法について


Japan SAS Discussionページに質問や意見(メッセージ)を投稿/返信する方法を簡単にご説明します。

詳細を読む