You could try something like below. It should work as long as you don't have variable names in your formulas with the same name like functions or formats etc.
data have;
infile datalines truncover dsd dlm=',';
input formula_have :$200. formula_want :$200.;
cards;
x/y + z, [x]/[y] + [z]
w-x ** z, [w]-[x] ** [z]
movave(x),%movave([x])
;
run;
data variables;
input without :$50. with :$50.;
datalines;
x [x]
y [y]
z [z]
;
run;
filename codegen temp;
data _null_;
file codegen;
set variables;
cmd= cats('formula_derived=prxchange("s/\b',without,'\b/',with,'/oi",-1,strip(formula_derived));');
put cmd;
run;
data want;
set have;
formula_derived=formula_have;
%include codegen / source2;
run;
proc print data=want;
run;
... View more