Send many tables data to differents spreadsheets in one excel file EG 5.1

Reply
Occasional Contributor
Posts: 17

Send many tables data to differents spreadsheets in one excel file EG 5.1

Hello. I have a project in EG 5.1, and I need send the data tables from the project to differents spreadsheets in one excel file. Is it possible?

Thanks in advanced.

Regards,

Francisco

Super User
Posts: 19,877

Re: Send many tables data to differents spreadsheets in one excel file EG 5.1

Posted in reply to Francisco

Do you mean different worksheets in one workbook? Say one tab for each table?

Yes, I believe so.

Occasional Contributor
Posts: 17

Re: Send many tables data to differents spreadsheets in one excel file EG 5.1

Hi Reeza. You are OK,, (different worksheets in one workbook-one tab for each table). How can I do this?

Super User
Posts: 19,877

Re: Send many tables data to differents spreadsheets in one excel file EG 5.1

Posted in reply to Francisco

How do you export a single table to a workbook right now? I ask because there's so many set ups so its easiest to see how your's is and then generalize.

Occasional Contributor
Posts: 17

Re: Send many tables data to differents spreadsheets in one excel file EG 5.1

The ways of export are:

1-                                                                                                                        2-

1.png2.png

Super User
Posts: 19,877

Re: Send many tables data to differents spreadsheets in one excel file EG 5.1

Posted in reply to Francisco

Figure out how to do one proc export via EG and post the answer here and we can generalize from there.

The reason I can't post it for you is because each set up is so different, you could be running EG from a server rather than a desktop or have 32/64 bit or Excel can be 32/64 bit...

If the following works it may give you an idea of how to proceed.

PROC EXPORT DATA = SASHELP.CLASS

File = "C:\temp\filename.xls"

DBMS = EXCEL Replace;

SHEET= "Sample Sheet"

RUN;

Or you can use tagsets.excelxp, which isn't a native excel file, but an XML file instead that opens in Excel.

ods tagsets.excelxp file="C:\temp\test.xml" style=journal options(sheet_interval='proc');

proc print data=sashelp.class;

run;

proc print data=sashelp.cars;

run;

ods tagsets.excelxp close;

N/A
Posts: 1

Re: Send many tables data to differents spreadsheets in one excel file EG 5.1

Posted in reply to Francisco

I've used this to send different datasets to different tabs in one excel workbook and we have SAS EG 5.1:

LIBNAME XLS EXCEL "\\path\folder\myfile.xlsx";

Proc SQL;

     Drop Table xls.tab1;

     Drop Table xls.tab2;

Quit;

Data xls.tab1;

     Set tab1; *dataset created earlier in program;

Run;

Data xls.tab2;

     Set tab2;

Run;

Libname xls Clear;

Ask a Question
Discussion stats
  • 6 replies
  • 365 views
  • 0 likes
  • 3 in conversation