I need to be able to place small datasets into the SAME excel spreadsheet at specific locations within that sheet. I have tried:
ods listing close; ods html close; goptions device=actximg; %let dat = %sysfunc(today(),yymmdd6.); ods excel file="h:\temp.xlsx"; ods excel options(embedded_titles="no" start_at="5,5" sheet_name="Sheet1" sheet_interval="none"); proc print data=EGTASK.NEW_PAIRS_FINAL; title "Expense Report Year 2016"; run; ods excel options (embedded_titles="no" start_at="50,30" sheet_name="Sheet1"); proc print data=EGTASK.NEW_PAIRS_FINAL; title "Expense Report Year 2016"; run; ods excel close;
It will place the first table in 5,5 as asked, but it will place the second table right under it (one line separating them) instead of 50,30. We need to place these at specific cells on the same sheet. Can this be done? Not sure what to do in this case.
Cheers!
You can if your tables go down (linear) but if you want side by side tables that won't fly with ODS EXCEL.
If you're using a Microsoft Window's system you can do it with the macro you can download from: http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export
Art, CEO, AnalystFinder.com
@BCNAV wrote:
Can this be done with another method? DDE?
Yes, but DDE is a pain. The documentation for DDE has an example on how to write data out and someone else just had a DDE question and their code is mostly correct 🙂
@art297 macro is another really good option as well.
For custom reports like that, I usually do a mix.
I create an Excel template with the data in the linear form and then link the table data over to the displayed view, so how I export the data isn't really relevant. This works with reports that have consistent structure and you have a good idea of the number of rows/tables/graphs that are needed ahead of time.
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!
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.