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?
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.