libname PR xlsx 'folders\pr.xlsx';
proc datasets lib=pr ;
copy out=work memtype=data ;
select pr: ;
run;
I want to work on sheets in xlsx file starting with PR (ex: PR1, PR2), imported using libname. And in select statement of Proc datasets step, it is showing error
"ERROR: The file PR.pr: (memtype=DATA) was not found, but appears on a SELECT statement." if I use small case (pr). The issue is not found when I use Upcase (PR). I knew that sas is case-insensitive to dataset names. Is there any exception to this ?
Thanks in advance,
Siva
The XLSX (and other such) engine does not work the same as the Base V9 engine, so it is very likely that it is case sensitive with regards to sheet or column names.
If you have mixed upper/lower case in the sheet names, consider retrieving the memnames from dictionary.tables, where you search case insensitive (e.g. where upcase(memname) like 'PR%'), but store memname as is into a macro variable for later use in the DATASETS procedure.
The XLSX (and other such) engine does not work the same as the Base V9 engine, so it is very likely that it is case sensitive with regards to sheet or column names.
If you have mixed upper/lower case in the sheet names, consider retrieving the memnames from dictionary.tables, where you search case insensitive (e.g. where upcase(memname) like 'PR%'), but store memname as is into a macro variable for later use in the DATASETS procedure.
Hi,
I can replicate what you describe under a SAS Windows version (9.04.01M7).
All works well when I use an upper case name in the Select statement - but throws and error if using lower case.
This feels more like an involuntary feature so may-be worth raising with SAS Tech Support.
Excel source used:
proc datasets lib=work kill nolist;
run;quit;
libname PR xlsx 'c:\temp\pr.xlsx';
proc datasets lib=pr;
copy
in=pr
out=work
memtype=data
;
select pr:
;
run;
quit;
libname PR clear;
proc datasets lib=work kill nolist;
run;quit;
libname PR xlsx 'c:\temp\pr.xlsx';
proc datasets lib=pr;
copy
in=pr
out=work
memtype=data
;
select PR:
;
run;
quit;
libname PR clear;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.