10-15-2015 11:09 AM
Simple data pull, not merging tables or anything. Can I replace null values in PROC SQL statement like I can in the following DATA satement:
IF OBS1 = . THEN OBS1 = 0;
I've looked at the IFN function but cannot get it to work or find any example to reference.
10-15-2015 11:15 AM
If statements dont function in proc sql but you can do either of the following.
Case when obs1 = . then 0 else obs1 end as obs1
or you can simply do this
sum(obs1, 0) as obs1
10-15-2015 11:26 AM
10-15-2015 11:24 AM
I am actually trying to perform an AVG function in a simple SQL statement:
PROC SQL; SELECT OBS1, OBS2, AVG(OBS3) AS AVGOBS FROM TABLE1; QUIT;
I'm trying to graph results but null values throws the results off.
10-15-2015 01:12 PM
If just to replace the missing value, A simple SUM should do:
PROC SQL; SELECT OBS1, OBS2, SUM(OBS3,0) AS OBS3 FROM TABLE1; QUIT;