BookmarkSubscribeRSS Feed
carlos_jimenez
Fluorite | Level 6

Hello.

 

The situation that I am facing is as follow.  I am running a code inside Excel using SAS Add-Ins.  This code produce three datasets.  I am having difficulties exporting/printing each dataset to its own tab.  Thoughts? 

 

Example, redirect the output for Asia and Europe to individual tabs in Excel.

data cars;
set sashelp.cars;
run;

proc print data=SASHELP.CARS(where=(Origin='Asia'));
;
run;

proc print data=SASHELP.CARS(where=(Origin='Europe'));
;
run;

4 REPLIES 4
ballardw
Super User

As a minimum you should include the code that you are running. Then we have a chance to follow the attempt and may be able to provide comments.

Better would be to show the Log from SAS when running your program to see if SAS is seeing potential problems.

SASKiwi
PROC Star

You don't have to code to do that. Just click on the Data icon in the SAS tab and click the Browse button. Select library SASHELP and dataset CARS and select Open. The default sheet name stays as Sheet1 but you can just change it.

 

SASKiwi_0-1667183159917.png

 

carlos_jimenez
Fluorite | Level 6
That was just an example since I cannot share privately owned data. The task is to export any resulting dataset to its respective tab.
SASKiwi
PROC Star

This works for any dataset of your choosing, not just those in the SASHELP library. You can specify sending your data to a new sheet and provide the name:

SASKiwi_0-1667186211521.png

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 473 views
  • 0 likes
  • 3 in conversation