Hi there, This is an example code. I have a xlsx file with multiple sheets. One sheet name its given to me (dsname) and i would like to control if its correct or not. If it is, do a set. I use a macro because its a recursive action. %let dsname=AE; /*Given to me*/
%macro doASet(name); libname test xlsx "C:\nameOfFile";
%if %sysfunc(exist(test.&name.)) %then %do;
data out;
set test."&name"n; /*for example*/
a = 8;
run;
%end;
%else %put ---Data set &name does not exist.;
%mend doASet;
%opends(dsname); If the sheet exist, i do a data set and its all correct but if the sheet doesn't i wish to display and error like that or do another thing, but actually exist funct return 1. Always return 1! I tried tones of combinations and I don't find the solution. I thank you in advance for your help. Regards
... View more