/* 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
*/
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.