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;
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.
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.
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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.