Hello Nancy,
You can also use the following macro approach:
data have;
infile datalines dsd dlm=';' truncover;
informat op $40. a b c d 8.;
input op a b c d;
datalines4;
a*b;1;2;3;4
2*(c*d);1;2;3;4
a*b;1;2;3;4
a+b+c;1;2;3;4
;;;;
run;
/* Putting ops into macro variables */;
proc SQL;
select count(*) as n into :n from have;
%let n=%TRIM(&n);
select op as o into :o1-:o&n from have
;quit;
/* Using macro variables as operations */;
%macro a;
%local i;
data want;
set have;
%do i=1 %to &n;
if _n_=&i then result=&&o&i;
%end;
run;
%mend a;
%a
Sincerely,
SPR
... View more