BookmarkSubscribeRSS Feed
🔒 This topic is locked. We are no longer accepting replies to this topic. Need further help? Please sign in and ask a new question.
SAS_Tipster
Moderator

I often need to store a 0 value in place of missing when reporting numeric values. I take advantage of the SUM function for this purpose. For each variable I sum itself with 0 as in:

 

COST = SUM(COST, 0);

The SUM function ignores missing values. So if COST is not missing, no change occurs. If COST is missing, it is now 0.

If only the display of missing values as 0 as needed, use the options statement (which does not change the internal value):

 

options missing = '0 ';
 
Originally posted by Terry on sasCommunity.org.
1 REPLY 1
Ksharp
Super User
proc stdize data=sashelp.class out=want missing=0 reponly;
var weight;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Visit a random SAS tip This SAS Tips board is not open for replies or comments, but we welcome your feedback and questions. Have a question or comment about this tip? Start a new topic in one of our discussion boards, and reference this tip topic.
Discussion stats
  • 1 reply
  • 3296 views
  • 7 likes
  • 2 in conversation