%let execpath = " "; %macro setexecpath; %let execpath = %sysfunc(getoption(sysin)); %if %length(&execpath) = 0 %then %let execpath = %sysget(sas_execfilepath); data _null_; do i = length("&execpath") to 1 by -1; if substr("&execpath", i, 1) = "\" then do; call symput("Path", substr("&execpath", 1, i)); stop; end; end; run; %mend setexecpath; %setexecpath; libname readfile excel "&Path.sample.xls"; proc print data = readfile.'Sheet1$'n; data sheet1; set readfile.'Sheet1$'n; y = rand('Normal'); proc print data = sheet1; run; libname readfile clear;
proc import を呼んで処理するのと同じ?
procedure に突っ込む場合も、data = readfile.'Sheet1$'n; のように書くことができます。