Chapter Contents

Previous

Next

How to Set Variable Values to Missing in a DATA Step

You can set values to missing within your DATA step by using program statements such as this one:

if age<0 then age=.;

This statement sets the stored value of AGE to a numeric missing value if AGE has a value less than 0.

Note:   You can display a missing numeric value with a character other than a period by using the DATA step's MISSING statement or the MISSING= system option.  [cautionend]

The following example sets the stored value of NAME to a missing character value if NAME has a value of "none":

if name="none" then name=' ';


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.