BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kleelasiva9
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

4 REPLIES 4
Kurt_Bremser
Super User

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.

kleelasiva9
Obsidian | Level 7
Thank you for knowledge support.
Patrick
Opal | Level 21

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:

Patrick_2-1639553827137.png

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;

Patrick_0-1639553686918.png

 

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;

Patrick_1-1639553761987.png

 

 

 

 

kleelasiva9
Obsidian | Level 7
Thanks for support!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1728 views
  • 8 likes
  • 3 in conversation