diff --git a/build.py b/build.py index 973c6f8..c4ab568 100755 --- a/build.py +++ b/build.py @@ -22,8 +22,15 @@ for file in files: for line in infile: ml.write(" put '" + line.rstrip().replace("'", "''") + " ';\n") ml.write("run;\n\n") + + ml.write("/* ensure big enough lrecl to avoid lua compilation issues */\n") + ml.write("%local optval;\n") + ml.write("%let optval=%sysfunc(getoption(lrecl));\n") + ml.write("options lrecl=1024;\n\n") + ml.write("/* execute the lua code by using a .lua extension */\n") ml.write("%inc \"%sysfunc(pathname(work))/" + name + ".lua\" /source2;\n\n") + ml.write("options lrecl=&optval;\n\n") ml.write("%mend " + name + ";\n") ml.close() diff --git a/lua/ml_gsubfile.sas b/lua/ml_gsubfile.sas index 41eef30..c2b873f 100644 --- a/lua/ml_gsubfile.sas +++ b/lua/ml_gsubfile.sas @@ -39,6 +39,14 @@ data _null_; put 'io.close(file) '; run; +/* ensure big enough lrecl to avoid lua compilation issues */ +%local optval; +%let optval=%sysfunc(getoption(lrecl)); +options lrecl=1024; + +/* execute the lua code by using a .lua extension */ %inc "%sysfunc(pathname(work))/ml_gsubfile.lua" /source2; +options lrecl=&optval; + %mend ml_gsubfile; diff --git a/lua/ml_json.sas b/lua/ml_json.sas index 08f0bfb..f501520 100644 --- a/lua/ml_json.sas +++ b/lua/ml_json.sas @@ -389,6 +389,14 @@ data _null_; put '-- JSON.LUA ENDS HERE '; run; +/* ensure big enough lrecl to avoid lua compilation issues */ +%local optval; +%let optval=%sysfunc(getoption(lrecl)); +options lrecl=1024; + +/* execute the lua code by using a .lua extension */ %inc "%sysfunc(pathname(work))/ml_json.lua" /source2; +options lrecl=&optval; + %mend ml_json;