Hi all, I am using the following code to export csv files from our Sasapp server to a shared network drive: %lET export_directory_RDP = G:\Exports;
%MACRO EXPORTDATA_RDP(DATA);
%global download_to_rdp download_from;
%let dsempty=0;
data _null_;
if eof then
do;
call symput('dsempty',1);
put 'NOTE: EOF - no records in data!';
end;
stop;
set &DATA end=eof;
run;
%if &dsempty. %then
%do;
%put WARNING: Export step skipped - no output records.;
%end;
%else
%do;
/* Data to export */
%let lib = work;
%let datafile = &DATA;
/* Local folder to download to */
%let download_to_rdp = &export_directory_RDP;
/* detect proper delim for UNIX vs. Windows */
%let delim=%sysfunc(ifc(%eval(&sysscp. = WIN),\,/));
/* specify a wildcard to export all csv files*/
%let download_from =
%sysfunc(getoption(work))&delim.%str(*).csv;
filename src "%sysfunc(getoption(work))&delim.&datafile..csv" encoding = "utf-8";
proc export data=&lib..&datafile.
DBMS = dlm
outfile=src
LABEL
replace;
DELIMITER = ";";
run;
filename src clear;
%end;
%MEND; and the following export step: This works very well but when my colleagues try to open the exported files the get the following error message: Cannot read file G:/Exports/filename.csv: Permission denied. Interestingly, it seems that some files that I exported today have today as creation date while others have the creation date in the past. The files with a creation date in the past do not show the permission error... Does anyone have an idea of what is going on here?
... View more