I've created an excel files library running this command
options validvarname=v7;
libname xlstorm xlsx '/folders/myfolders/storm.xlsx';
but i can't seem to find the worksheet in the library. so how do i do this so i can access the excel worksheet?
There's no error message. And i've tried the path you mentioned before, didn't work either.
Please post the log
Hi,
I have tried to read the storm's excel workbook from the library I have created, however, I am unable to access the file.
Attached is the log message after creating the active library.
@Gordonmolapo wrote:
Attached is the log message after creating the active library.
There is no problem. The library reference was successfully created, now use it.
In the future, post your logs by just copy/pasting them into a window opened with this button:
The "little running man" right next to it is for posting SAS code (provides coloring similar to the SAS Enhanced Editor).
Hi Kurt,
I am using SAS Enterprise guide 7.1. Even after successfully creating the active library, the excel sheets do not appear in the library that I have created.
What are the names of your sheets? If they do not follow the rules for valid SAS names, you will have to use
options validmemname=extend;
Sheet names
Please post the code you used to actually read that first sheet.
If you want to read all your sheets in one procedure, use PROC COPY:
proc copy
in=xstorms
out=work
;
run;
libname xstorms '\\HO125489-T\Users\LebohangM\Documents\EPG194\data'; proc import datafile='\\HO125489-T\Users\LebohangM\Documents\EPG194\data\storm.xlsx' dbms=xlsx out=xstorms.storm replace; run;
@Gordonmolapo wrote:
libname xstorms '\\HO125489-T\Users\LebohangM\Documents\EPG194\data'; proc import datafile='\\HO125489-T\Users\LebohangM\Documents\EPG194\data\storm.xlsx' dbms=xlsx out=xstorms.storm replace; run;
If you do not tell PROC IMPORT which worksheet to import from the workbook it will import the first sheet.
PROC IMPORT without a sheet name will only import the first sheet. IMPORT creates one dataset, so it has to select one sheet, and if you do not tell it which, it defaults to the first.
If you want to import multiple sheets, your best option is PROC COPY from a libname you defined with LIBNAME XLSX.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.