I am trying to understand how Call Execute works.. I tried a very simple program which creates a library reference
Below is sample code..
data _null_;
set files;
call execute('LIBNAME sasdata2 ''C:\DAG\SAS\Samples\'';'
);
run;
It runs fine with following in the log -
+ LIBNAME sasdata2 'C:\DAG\SAS\Samples\';
NOTE: Libref SASDATA2 was successfully assigned as follows:
Now if I change my code to use a variable instead of actual string value for libname
as below
data _null_;
set files;
call execute('LIBNAME sasdata2 '''||folderName||''';'
);
run;
I get the following -
NOTE: CALL EXECUTE generated line.
1 + LIBNAME sasdata2 'C:\DAG\SAS\Samples\
2 +
WARNING: The quoted string currently being processed has become more than 262 characters long. You may have
unbalanced quotation marks.
3 + ';
ERROR: Invalid physical name for library SASDATA2.
ERROR: Error in the LIBNAME statement.
4 + LIBNAME sasdata2 'C:\DAG\SAS\Samples\
5 +
it seems to be taking the right value from the dataset files. I tried some changes in quoatations i have, to see if there is any issue. But didn't help.
Any suggestions??
Thanks,
Neel