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

Hi, 

    I am using SAS ODS EXCEL to create a multi tab excel spreadsheet.   I would like to have tabs with output and then some tabs with text.    I was going to use PROC ODSTEXT for the text, 

 

    However, I can't the PROC ODS TEXT output to appear on its own tab. 

 

   I have attached my code as well as the excel output.  

 

   Any suggestions on how to achieve this? 

 

Thanks,

Alan

 

1 ACCEPTED SOLUTION

Accepted Solutions
adleach2
Fluorite | Level 6

However,  it the SHEET_INTERVAL="PROC" does put the PROC ODS TEXT on a new page. 

 

Thanks @Reeza for pointing me in the right direction. 

View solution in original post

5 REPLIES 5
Reeza
Super User

Can you please post your code to the forum rather than as an attachment? It makes it easier to answer your question.

Thanks!

 

I'm assuming you've tried setting sheet_interval to now before the PROC ODSTEXT via ODS EXCEL options?

 

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

 

NOW

creates a new worksheet. When used, the next output object starts on a new sheet. After SHEET_INTERVAL='NOW' is executed, the SHEET_INTERVAL option reverts to the previous setting.

Interaction The option SHEET_INTERVAL='NONE' overrides the PAGEBREAK=NO option for PROC ODSTEXT and PROC ODSLIST. That is, SHEET_INTERVAL='NOW' creates a new worksheet when PROC ODSLIST or PROC ODSTEXT uses the PAGEBREAK=NO option.
Example ods excel options (sheet_interval='now');

 


@adleach2 wrote:

Hi, 

    I am using SAS ODS EXCEL to create a multi tab excel spreadsheet.   I would like to have tabs with output and then some tabs with text.    I was going to use PROC ODSTEXT for the text, 

 

    However, I can't the PROC ODS TEXT output to appear on its own tab. 

 

   I have attached my code as well as the excel output.  

 

   Any suggestions on how to achieve this? 

 

Thanks,

Alan

 


 

adleach2
Fluorite | Level 6
@Reeza Here is My codes as requested

data work_path;

work_path = pathname ( "WORK" ) ;

call symput ( "work_path", trim(work_path) ) ;
run;


ods excel file="&work_path./test.xlsx";


ods excel options(sheet_name="Output 1" sheet_interval="output");


proc print data=sashelp.class;
run;


ods excel options(sheet_name="TEXT" sheet_interval="output");

proc odstext ;

p 'NEED THIS ON A NEW TAB';

run;


ods excel options(sheet_name="Output 2" sheet_interval="output");
proc tabulate data=sashelp.class;
class age sex;
table age, sex;
run;


ods EXCEL close;
adleach2
Fluorite | Level 6

Unfortunately it looks like I don't have the SHEET_INTERVAL="NOW" options available to me.

 


ERROR: Argument now for word option sheet_interval not recognized. Expecting one of these keywords output, table, page, bygroup,
bygroups, proc, none or none.

 

We are on SAS  9.04.01M3P062415 

adleach2
Fluorite | Level 6

However,  it the SHEET_INTERVAL="PROC" does put the PROC ODS TEXT on a new page. 

 

Thanks @Reeza for pointing me in the right direction. 

Reeza
Super User

9.4M3 is the first version where ODS Excel is in production. 

If you can upgrade at all, I'd highly recommend it. It's still quite buggy in that version.

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 2180 views
  • 1 like
  • 2 in conversation