Get the code to work for one set of values (datasets, variables etc).
Then change the variable part to use macro variable references (which is kind of like your posted pseudo code). Just set the macro variable values with %LET statements at the top. Get that to work for the same example values.
%let data=data1;
%let refdata=data1a;
....
proc stdrate
data=&data
refdata=&refdata
...
Then remove the %LET statements and wrap the code into a macro using the names of those macro variables as the parameters to the macro. Convert the %LET statements into the values of the macro in the call to the macro. Again get that to work for your example.
%macro mystdrate
(data=
,refdata=
...
);
proc stdrate
data=&data
refdata=&refdata
...
%mend;
%mystdrate
(data=data1
,refdata=data1a
...
);
Then just call the macro multiple times with each of your combinations of values.
%mystdrate
(data=data2
,refdata=data2a
...
);
If you actually have the list of values in a dataset then you can use the dataset to generate the calls. But if you don't have the dataset it is not really worth making it. Just write the individual macro calls.