Hi,
Its possible to add more then two tables in none excel sheet (xlsx format).
Eg. I have 2 tables and need to display in one excel sheet. it's possible or not. If possible then how?.
Yes it is possible. In pre 9.4 days, and probably still, the best method is ods tagsets.excelxp + proc report:
https://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html
This doesn't create a native Excel file, but an XML file that Excel can read and interpret, but gives great flexibility and formatting.
Then there is libname excel - which is newer (9.4), and creates native files. It didn't seem as flexibile or useful to me though at the moment:
http://www2.sas.com/proceedings/sugi31/024-31.pdf
There are other methods, but I would go with the above first. Proc export tends to be a best guess, DDE is far to old to be used etc.
Another option would be to use Add-in for MS Office, where the Excel report pulls data from SAS. And you can design your Excel report exactly the way you wish.
In SAS 9.4 there's also ODS Excel, similar to ODS tagsets which does generate a native excel file.
Proc of export and XLSX will also support multiple sheets in SAS 9.4+
Hi,
please find attachment for more details.
table one # New Appointments fixed
teble two # Meetings scheduled (due).
i want both in same sheet.
@Shantaram, you've had already received some input.
So the next step is that you explore those options - and then return with any relevant follow-up questions if necessary.
Hi Linush,
I got your point but i want output in one page not in two diffrent pages.
ODS tagsets.excelxp file='sample.xml' options(sheet_interval=none);
proc print data=sashelp.class;
proc print data=sashelp.air;
run;
ods tagsets.excelxp close;
Change the file destination to somewhere that makes sense for you and open the resulting file in Excel.
Hi
check out the ODS EXCEL destination
code will look similar to
ods excel file="c:\temp\sample.xlsx" options(SHEET_INTERVAL= 'NONE');
proc print data=sashelp.class;
where sex = "F";
run;
proc print data=sashelp.class;
where sex = "F";
run;
ods excel close;
Bruno
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.