/* 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
*/
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.