I'm trying to use PROC FCMP with the function SOLVE to solve non-linear equations and insert solutions into the table automatically. For instance
proc fcmp;
/* define the function */
function inversesqrt(x);
return(1/sqrt(x));
endsub;
y = 20;
x = solve("inversesqrt", {.}, y, .);
put x;
run;
After running above code x will be shown in results but i cannot utilize it in further code. I tried to save x as macro variable or as table but nothing works for me. Can somebody help me, please?
Create a second
fcmp
function to return the solve.