I tried running the following code today:
%let mapping_table=work.config;
proc lua restart;
submit "mapping_table=&mapping_table" ;
print(mapping_table)
endsubmit;
run;
Which resulted in:
ERROR: SUBMIT block:1: attempt to index global 'work' (a nil value)
Removing the period (.) resolves the issue.
Is this a bug? Or a feature?
SYSVLONG=9.04.01M3P062415
Try using single quotes around the macro variable in the SUBMIT statement:
%let mapping_table=work.config;
proc lua restart;
submit "mapping_table='&mapping_table'" ;
print(mapping_table)
endsubmit;
run;
Try using single quotes around the macro variable in the SUBMIT statement:
%let mapping_table=work.config;
proc lua restart;
submit "mapping_table='&mapping_table'" ;
print(mapping_table)
endsubmit;
run;
Another (more reliable) approach is to use sas.symput function:
%let mapping_table=work.config;
proc lua restart;
submit;
mapping_table = sas.symget('mapping_table')
print(mapping_table)
endsubmit;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.