For SAS customers who have access to SAS Viya 3.5, you can solve this problem by using BY-group processing in the runOptmodel action:

data sascas1.Params;
set Params;
run;

proc cas;
source pgm;
num a, b;
read data Params into a b;

var X {1..2};
max Z = 1 - (X[1]-a)^2 - (X[2]-b)^2 + exp(-0.5*(X[1]^2 + X[2]^2));

put a= b=;
solve;
print X;

create data summary from obj=_OBJ_ solstatus=_solution_status_ X1=X[1] X2=X[2];
endsource;

action optimization.runOptmodel result=r / printlevel=0 code=pgm groupBy={'a','b'};
run;
quit;

proc print data=sascas1.summary;
run;