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

So I have been looking at this issue over and over and I am still not 100% sure how to get this to work.  I have 7 data sets that I need to place on one Excel sheet (sorta like a template).  I understand with ODS how to put these on separate sheets, but not sure how to put these all on one spreadsheet.

 

Thanks for any guidance on this. 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:
Look for previous postings about the use of ODS EXCEL and the (sheet_interval='none') suboption.

Here's a quick example using just a few rows out of 3 different datasets.

ods excel file='c:\temp\all_together_now.xlsx'
    options(sheet_interval='none');

  proc print data=sashelp.class(obs=3);
  run;

  proc print data=sashelp.cars(obs=3);
    var make model type enginesize msrp invoice;
  run;

  proc print data=sashelp.shoes(obs=3);
    var region subsidiary product sales inventory returns;
  run;

ods excel close;



Hope this helps,
Cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:
Look for previous postings about the use of ODS EXCEL and the (sheet_interval='none') suboption.

Here's a quick example using just a few rows out of 3 different datasets.

ods excel file='c:\temp\all_together_now.xlsx'
    options(sheet_interval='none');

  proc print data=sashelp.class(obs=3);
  run;

  proc print data=sashelp.cars(obs=3);
    var make model type enginesize msrp invoice;
  run;

  proc print data=sashelp.shoes(obs=3);
    var region subsidiary product sales inventory returns;
  run;

ods excel close;



Hope this helps,
Cynthia

IgawaKei29
Quartz | Level 8

Thank you Cynthia, that sheet_interval=none was the piece I was missing.  Do you know if it is possible to direct SAS where to place the data on the sheet?  That was also something I saw a few articles about, but was confused how to implement.

 

Appreciate your help on this, now I can be more SAS dangerous 🙂

Cynthia_sas
Diamond | Level 26
Hi, you'll have to search in the ODS EXCEL documentation. I believe there is a "start_at" suboption, but it applies to where the WHOLE sheet should start, you can't place one value in column B row 3 and another value in column D row 5, if that's what you're thinking of.

Cynthia

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

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