Hi,

How to export data to this newly created folder and into excel file that is being created while proc export procedure ? Would you help me ?

%Let path = C:\myfiles;
%Let dirname= "dirname";
%Let xlsxfile = "test.xlsx";

data _null_;
newdir=dcreate(&dirname, &path);
run;

data cars;
set sashelp.cars;
run;

proc export
data = cars
outfile = &path&dirname&xlsxfile
dbms= xlsx REPLACE;
Sheet = "Success";
run;