The EXPORTS special
variable contains a map in the binding. Adding a key or value pair
to this map will create a SAS macro variable when PROC GROOVY ends.
Groovy is case sensitive, but macros are not. If two keys exist in
the map that differ only by their case, then the one that is exported
into a SAS macro is not determined. You can also replace the EXPORTS
variable in the binding with any object that inherits from java.util.Map.
If you replace the variable, all of the key or value pairs in that
object will be exported.
proc groovy;
eval "exports.fname = ""first name""";
eval "binding.exports.lname = ""last name""";
eval "exports.put('state', 'NC')";
quit;
data _NULL_;
put "----> &fname &lname: &state";
run;
proc groovy;
submit;
exports = [fname:"first name", lname: "last name", state: "NC"]
endsubmit;
quit;
data _NULL_;
put "----> &fname &lname: &state";
run;