data one;
infile datalines missover;
input age;
if age is missing then age=9999;
else age=age;
cards;
8
01
20
0
1
2
;
proc print;
run;
Hi,
You probably want the missing FUNCTION. Try:
if missing(age) then age=9999;
Also I would suggest you use SAS special missing values instead of numeric codes. So:
if missing(age) then age=.S;
--Q.
Also, the "is missing" syntax is used with the "where" clause, as in Proc SQL or as a filter on Proc freq, for example.
Proc freq data = . . . ;
where age is missing ;
tables . . . ;
In a DATA step, use:
if age = . then age = 9999 ;
(and you really don't need the else clause)
Or
if missing(age) then age=9999;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.