Replace Missing Numeric Values using Missing Option/Proc STDIZE

This post was kindly contributed by StudySAS Blog - go there to comment and to read the full post.


MISSING OPTION

Replacing missing values with the desired value like a zero is always a challenge, especially when we have a dataset with a number of columns to standardize. The OLD WAY of doing it to write a DATA step code with  if……then statements like…

 

if var=. then var=0;

to make 0 appear instead of . (dot) in the tables output.

With the SAS option called missing you can save a lot of typing.  If you place the following SAS option code before the generation of the table output:

Option missing=”0″;

SAS will display 0 (zero) instead of the . (dot) on the table. In fact it can display whatever the character we would like to display for missing values.  You can use a – (line) or * (star).

Always change it back the option missing setting to default as  Option Missing=”;  otherwise you may endup getting unexpected results;

Warning: Since we are using this option to display zeros instead of .(dots), you…

[[ This is a content summary only. Visit my website for full links, other content, and more! ]]

This post was kindly contributed by StudySAS Blog - go there to comment and to read the full post.