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

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.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

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