I have SAS stored process that ceates DBF file from SAS data set rr_udf_value and finds its size (F_SIZE):
filename dbfout "/SASInside/DBF/myfile";
proc export
data=rr_udf_value
outfile=dbfout
dbms=dbf
replace;
run;
%let f_nm=/SASInside/DBF/myfile.DBF;
%let rc=%sysfunc(filename(onefile, &f_nm.));
%let fid=%sysfunc(fopen(&onefile));
%let F_SIZE=%sysfunc(finfo(&fid,File Size (bytes)));
%put &F_SIZE;
The problem is that the variable F_SIZE is empty in STP log. But if after execution of STP I run commands
%let f_nm=/SASInside/DBF/myfile.DBF;
%let rc=%sysfunc(filename(onefile, &f_nm.));
%let fid=%sysfunc(fopen(&onefile));
%let F_SIZE=%sysfunc(finfo(&fid,File Size (bytes)));
%put FSIZE=&F_SIZE;
manually, everithing is OK: F_SIZE=17342.
Why F_SIZE is not initialized while running STP, and how could I fix it?
Thanks in advance!
filename()
is restricted in environments withOPTION NOXCMD
, which is by default set for server environments. This is for security reasons (asXCMD
allows shell access). You can enable this with by enablingOPTION XCMD
, though your server admin (if this is not you) would have to enable it on the server and not in your local session typically.See the SAS documentation on XCMD for more information.