BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kajal_30
Quartz | Level 8

Hi 

 

I am trying creating an excel file with three tabs after an extract transformation.Can anyone help me with the transformation.

 

Thanks

Kajal

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

First example in the documentation covers this:

https://documentation.sas.com/?docsetId=odsug&docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&docsetVe...

 

Specifically for your issue - I think your name is too long so SAS ends up truncating it - limit on worksheet name in Excel is 30 characters. The examples you've shown would fit 30 but not all would.

 


ods EXCEL FILE = "/home/xxxxxx/Demo1/report.xlsx"
options(sheet_interval="bygroup"
           suppress_bylines="yes"
           sheet_label="Report for Jan 2011"
           embedded_titles="yes"
           embed_titles_once="yes" );


proc report data=sashelp.cars;
by make;
run;

ods excel close;

This gets you pretty close.

 


@kajal_30 wrote:

I am creating a file 

ods EXCEL FILE = "/user/kajal30/report.xlsx"
options (sheet_interval = 'bygroup'
sheet_label = 'origin');
proc report data=sashelp.cars;
by make;
run;

 

Here I need an excel sheet with multiple tabs ( each tab for diff make ) and name them as year_report_for_jan2011_honda, year_report_for_jan2011_acura, year_report_for_jan2011_tesla ........ and so on.

 

Hope this helps

 

Thanks

 



 

 

 

View solution in original post

4 REPLIES 4
Reeza
Super User

ODS EXCEL or PROC EXPORT are the methods for creating an Excel file. Both have examples in the documentation. 

 

Vague questions get vague answers, if you need more assistance please provide more details. 

 


@kajal_30 wrote:

Hi 

 

I am trying creating an excel file with three tabs after an extract transformation.Can anyone help me with the transformation.

 

Thanks

Kajal

 


 

kajal_30
Quartz | Level 8

I am creating a file 

ods EXCEL FILE = "/user/kajal30/report.xlsx"
options (sheet_interval = 'bygroup'
sheet_label = 'origin');
proc report data=sashelp.cars;
by make;
run;

 

Here I need an excel sheet with multiple tabs ( each tab for diff make ) and name them as year_report_for_jan2011_honda, year_report_for_jan2011_acura, year_report_for_jan2011_tesla ........ and so on.

 

Hope this helps

 

Thanks

 

Reeza
Super User

First example in the documentation covers this:

https://documentation.sas.com/?docsetId=odsug&docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&docsetVe...

 

Specifically for your issue - I think your name is too long so SAS ends up truncating it - limit on worksheet name in Excel is 30 characters. The examples you've shown would fit 30 but not all would.

 


ods EXCEL FILE = "/home/xxxxxx/Demo1/report.xlsx"
options(sheet_interval="bygroup"
           suppress_bylines="yes"
           sheet_label="Report for Jan 2011"
           embedded_titles="yes"
           embed_titles_once="yes" );


proc report data=sashelp.cars;
by make;
run;

ods excel close;

This gets you pretty close.

 


@kajal_30 wrote:

I am creating a file 

ods EXCEL FILE = "/user/kajal30/report.xlsx"
options (sheet_interval = 'bygroup'
sheet_label = 'origin');
proc report data=sashelp.cars;
by make;
run;

 

Here I need an excel sheet with multiple tabs ( each tab for diff make ) and name them as year_report_for_jan2011_honda, year_report_for_jan2011_acura, year_report_for_jan2011_tesla ........ and so on.

 

Hope this helps

 

Thanks

 



 

 

 

kajal_30
Quartz | Level 8

Thank you so much

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 1613 views
  • 0 likes
  • 2 in conversation