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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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