Hi Everyone,
I have a proc sql table that outputs the dataset below:
proc sql;
create table testtable as
select sum(numerator) as n,
sum(denominator1) as d1,
sum(denominator2) as d2,
sum(denominator3) as d3,
sum(denominator4) as d4
from work.responserate_sex;
quit;
Which outputs as:
n | d1 | d2 | d3 | d4 |
93 | 66 | . | 3 | . |
I am trying to create a new variable called result which would be written as
result = n / ((d1 + d2) - (d3) + (d4))
data testtable;
set testtable;
result = n / ((d1 + d2) - (d3) + (d4));
run;
this outputs a blank cell for the new variable result and I'm not sure why. Can anyone help me out as to why this may be the case?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.