For example, the LUA file is at c:\lua\test.lua
/* #1. using INFILE option of PROC LUA */ FILENAME LUAPATH "c:\lua"; PROC LUA INFILE="test"; RUN; /* #2. leverage current folder */ X "CD c:\lua"; PROC LUA; SUBMIT; dofile("test.lua") ENDSUBMIT; RUN; /* #3. using absolute path */ PROC LUA; SUBMIT; dofile(c:\\lua\\test.lua) -- escape backslash character dofile [[c:\lua\test.lua]] -- or using [[ and ]] ENDSUBMIT; RUN; /* #4. %INCLUDE statement supports both SAS and LUA starting from 9.4 */ %INCLUDE "c:\lua\test.lua"; /* $5. passed by SUBMIT option */ %let luaname=c:\lua\test.lua; PROC LUA; SUBMIT "name=[[&luaname]]"; print(name) dofile(name) ENDSUBMIT; RUN;
No comments:
Post a Comment