BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ronein
Meteorite | Level 14

Hello

Why Do I get error here?

Should I always write the XLSX file name in the path?

(When I export into sas data set and not XLSX file then I dont write the data set name in the path ...)

ERROR: File RON.EX3.DATA does not exist.

libname Ron clear;
libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/";
data Ron.EX3;
set sashelp.cars;
run;

and here it is working well with  no error

libname Ron clear;
libname Ron  "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/";
data Ron.EX3;
set sashelp.cars;
run;

Note-

Here are some examples  



/***WAY1--Create XLSX file  called EX1 with one sheet called EX1***/
libname Ron clear;
libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/EX1.xlsx";

data Ron.EX1;
set sashelp.cars;
run;


/***WAY2--Create XLSX file  called EX2with one sheet called MySheet***/
libname Ron clear;
libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/EX2.xlsx";
data Ron.MySheet;
set sashelp.cars;
run;


/***WAY3--Create XLSX file  called EX3**/
/**Not work !!error***/
libname Ron clear;
libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/";
data Ron.EX3;
set sashelp.cars;
run;

/**Work well**/
libname Ron clear;
libname Ron  "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/";
data Ron.EX3;
set sashelp.cars;
run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

The BASE SAS libref engine need to be pointed to a directory.  It will create/look for files with .sas7bdat extension in that directory.

The XLSX libref engine needs to be pointed to a FILE.  It will create/look for worksheets within that file.

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

The BASE SAS libref engine need to be pointed to a directory.  It will create/look for files with .sas7bdat extension in that directory.

The XLSX libref engine needs to be pointed to a FILE.  It will create/look for worksheets within that file.

ChrisHemedinger
Community Manager

Think of the XLSX file as a "folder" for data sets, and each sheet is a data set within that folder. The XLSX engine (like the JSON engine, XML engine and others) can work with a collection of "data tables" within one actual file.

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 2 replies
  • 907 views
  • 3 likes
  • 3 in conversation