Search code examples
sas

SAS Studio XLSX Engine


I am learning SAS and I was following the instruction in the SAS Programming 1: Essentials to create a library named xlclass using the XLSX engine to read Excel workbooks.

I kept getting the following error. I am not quite sure why.

ERROR: Invalid physical name for library XLCLASS. ERROR: Error in the LIBNAME statment.

I am using SAS Studio instead of a local SAS instance.

I have searched the error msg but no one seems to discuss the case of SAS Studio.

Update: turns out I have to specify the name of the excel file not just the folder containing it.


Solution

  • You usually name an XLSX file with a .xlsx extension, but you can use any filename you want. Your filename has no extension, which should also work. If the file named does not exist then SAS will assume you plan to write to the file so the LIBNAME statement will work.

    But you cannot use the name of a directory.

    Include the full name of the file in the LIBNAME statement.