Below are the sample code to demonstrate the concepts:
filename test temp;
libname test "c:\";
%macro test;
%put outside;
%mend;
proc lua restart;
submit;
sas.submit [[
/* It will fail to delete existing fileref or library */
filename test clear;
libname test clear;
]]
endsubmit;
run;
proc lua restart;
submit;
sas.submit [[
filename test temp;
libname test "c:\temp";
options obs=0;
%macro test;
%put inside;
%mend;
filename test list;
libname test list;
proc options option=obs; run;
%test
]]
endsubmit;
run;
filename test list;
libname test list;
proc options option=obs; run;
%test