The SAS Output Delivery System and reporting techniques

ODS EXCEL MULTIPLE TABS

Reply
Contributor
Posts: 29

ODS EXCEL MULTIPLE TABS

Hi, All.

 

I have an issue while exporting proc report to excel using ODS. I am using a macro which has all the names of individual persons and individual excel tabs needs to be created for every unique person in a single excel file.

 I am using the below code where it is generating only one excel tab  for only the last person in the macro . I am giving macro name in the sheet_name option. I want to create individual excel tabs for every person in the macro. please help me.

 

ods excel file="\c\desktop\output\temp.xlsx" options (sheet_interval="none" sheet_name="&Name" embedded_titles="YES");

Super User
Posts: 23,958

Re: ODS EXCEL MULTIPLE TABS

Posted in reply to VISHNU239

Any reason you can't just use by group processing?

 

proc sort data=sashelp.cars out=cars; by make;
run;

ods excel file='/folders/myfolders/demo.xlsx' options (sheet_interval='bygroup');

proc print data=cars;
by make;
run;

ods excel close;

Anyways, if you can't for some reason you can control the sheet interval with the Sheet_interval and Sheet_label options in the ODS OPTIONS. 

 

http://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=odsug&docsetTarget=p09n5pw9ol0...

 


@VISHNU239 wrote:

Hi, All.

 

I have an issue while exporting proc report to excel using ODS. I am using a macro which has all the names of individual persons and individual excel tabs needs to be created for every unique person in a single excel file.

 I am using the below code where it is generating only one excel tab  for only the last person in the macro . I am giving macro name in the sheet_name option. I want to create individual excel tabs for every person in the macro. please help me.

 

ods excel file="\c\desktop\output\temp.xlsx" options (sheet_interval="none" sheet_name="&Name" embedded_titles="YES");


 

Super User
Posts: 13,889

Re: ODS EXCEL MULTIPLE TABS

Posted in reply to VISHNU239

@VISHNU239 wrote:

Hi, All.

 

I have an issue while exporting proc report to excel using ODS. I am using a macro which has all the names of individual persons and individual excel tabs needs to be created for every unique person in a single excel file.

 I am using the below code where it is generating only one excel tab  for only the last person in the macro . I am giving macro name in the sheet_name option. I want to create individual excel tabs for every person in the macro. please help me.

 

ods excel file="\c\desktop\output\temp.xlsx" options (sheet_interval="none" sheet_name="&Name" embedded_titles="YES");


What do you think the option sheet_interval="none" does? Consider: SHEET=TAB in concept. Then read that option carefully.

 

BY groups are almost always the way to go unless you have two or more different elements per "tab" that come from different procedures.

Ask a Question
Discussion stats
  • 2 replies
  • 113 views
  • 0 likes
  • 3 in conversation