/* 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 the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.
Ready to level-up your skills? Choose your own adventure.