Unfortunately, this does not work in my case. I use a similar code but within a loop, where I create an excel file in every step:
%let copycmd1 = COPY "&manpath.\Stoch_Vorlage.xls"
"&manpath.\Stoch_&klasse..xls" ;
data _null_;
option noxwait;
X ©cmd1;
run;
libname excel1 excel "&manpath.\Stoch_&klasse..xls";
PROC Datasets lib = excel1 nolist;
delete KLASSE;
Quit;
Data excel1.KLASSE;
set ref_&jj;
run;
libname excel1 clear;
PROC Delete data = work.ref_&jj;
%end;
Log tells me my prepared data sheet 'KLASSE' would not exsist and creates a new one 'KLASSE1'
NOTE: Libref EXCEL1 was successfully assigned as follows:
Engine: EXCEL
Physical Name: Q:\[correct directory]\Stoch_12_42 .xls
MPRINT(ALLKLASSE): PROC Datasets lib = excel1 nolist;
MPRINT(ALLKLASSE): delete KLASSE;
MPRINT(ALLKLASSE): Quit;
NOTE: The file EXCEL1.KLASSE (memtype=DATA) was not found, but appears on a DELETE statement.
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
Result: in Stoch_12_42 .xls, KLASSE is not replaced, but the data has been added in a new sheet KLASSE1.
There are references from graphics to KLASSE which I do not want to calculate individually but to be created in each loop step respectively.
Thanks
Gregor
... View more