/* test data */
data one;
do i = 1 to 1e6/2;
a=1; b=2; c='a+b'; d=0; output;
a=1; b=2; c='a-b'; d=0; output;
end;
run;
data two;
set one;
length m $200;
retain popen '(' pclose ')';
m = c;
m = transtrn(m, 'a', catt(popen, put(a,best.-l), pclose));
m = transtrn(m, 'b', catt(popen, put(b,best.-l), pclose));
m = catt('%sysevalf', popen, m, pclose);
d = input(resolve(m), best.);
keep a b c d;
run;
/* on log
NOTE: There were 1000000 observations read from the data set WORK.ONE.
NOTE: The data set WORK.TWO has 1000000 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 25.53 seconds
cpu time 25.52 seconds
*/
proc print data=two(obs=3);
run;
/* on lst
Obs a b c d
1 1 2 a+b 3
2 1 2 a-b -1
3 1 2 a+b 3
*/
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.