05-04-2016 04:11 AM
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?.
05-04-2016 04:29 AM
Yes it is possible. In pre 9.4 days, and probably still, the best method is ods tagsets.excelxp + proc report:
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:
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.
05-04-2016 04:43 AM
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.
05-04-2016 04:48 AM
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+
05-04-2016 06:15 AM
please find attachment for more details.
table one # New Appointments fixed
teble two # Meetings scheduled (due).
i want both in same sheet.
05-04-2016 06:36 AM
@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.
05-04-2016 08:36 AM
ODS tagsets.excelxp file='sample.xml' options(sheet_interval=none);
proc print data=sashelp.class;
proc print data=sashelp.air;
ods tagsets.excelxp close;
Change the file destination to somewhere that makes sense for you and open the resulting file in Excel.
05-04-2016 08:44 AM
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;