The way to change the value of a variable in SAS is to use an assignment statement.
fact_4 = .;
The way to test if a variable has a specific value is to test for equality with
=. To conditionally execute a statement use the IF/THEN structure.
if fact_4 = -980 then fact_4 = .;
To test if a variable is any of a list of values use the
IN operator instead.
if fact_4 in (-980 -987 -995) then fact_4 = .;
Note that those statements work in a DATA step. So if your existing dataset is named HAVE you should run a data step to create a new dataset named WANT that has the values changed.
So your full program might look like:
data want; set have; if fact_1 in (-980 -987 -995) then fact_1 = .; if fact_2 in (-980 -987 -995) then fact_2 = .; if fact_3 in (-980 -987 -995) then fact_3 = .; if fact_4 in (-980 -987 -995) then fact_4 = .; run;
If you have a lot of similar variables then you probably will want to use an ARRAY rather than creating wallpaper code.
data want; set have; array fix3 fact_1-fact_4; do index=1 to dim(fix3 ); if fix3[index] in (-980 -987 -995) then fix3[index]= .; end; drop index; run;