Friday, March 23, 2018

LUA - it is safe to drive SAS

PROC LUA can create safe environment to drive SAS because you don't worry about changing any existing library, fileref, macros and global options outside LUA session. Furthermore, you can also setup new library, fileref, macros and global options in LUA session. It will maintain all of them inside LUA session until it terminates or restarts.

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

1 comment:

Clinnovo said...

Clinnovo Research Labs provides Internships, Trainings, Job Assistance in the Domains of Clinical Research, Clinical Data Management, SAS, Pharmacovigilance. For more details contact us @ +91-9985492233. www.clinnovo.com

SAS training
SAS course
SAS Certification
SAS Certification course
Online SAS Training