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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 4130 views
  • 7 likes
  • 2 in conversation