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

I am using XLSX engine to create XLSX file with 4 sheets (Export SAS data sets into XLSX file).

It is working 100% and I can see the XLSX that was created via SAS .

 

libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/Example4sheets.xlsx";

data Ron.cars;
set sashelp.cars;
run;
 
data Ron.classfit;
set sashelp.classfit;
run;
 
data Ron.baseball;
set sashelp.baseball;
run;
 
data Ron.air;
set sashelp.air;
run;
libname Ron clear;

Then I close SAS and open SAS again and I want to import the XLSX file -sheet1  into SAS data set called baseball

What is the way to do it please?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Which of the four sheets you created do consider SHEET1?

Looks to me like you created sheets named CARS CLASSFIT BASEBALL and AIR.

 

If you want to copy out CARS then run code like:

libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/Example4sheets.xlsx";
data want;
  set ron.cars;
run;

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

Which of the four sheets you created do consider SHEET1?

Looks to me like you created sheets named CARS CLASSFIT BASEBALL and AIR.

 

If you want to copy out CARS then run code like:

libname Ron XLSX "/usr/local/SAS/SASUsers/LabRet/UserDir/Udclk79/Targilim/Example4sheets.xlsx";
data want;
  set ron.cars;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1 reply
  • 536 views
  • 1 like
  • 2 in conversation