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

Hi everyone

I am exporting a data set to excel using this data step

data _null_;
set ERS_CMP.CMP_ERS_MQ12 (obs = 100);
file "/CEGSAS/ERS/MQ12_TESTE.xls";
put (_all_) (:);
run;

The question is:

Is it a way to export to excel when you don't have the excel engine, or do i really need to have a excel engine

to export datas to excel?

I opened the MQ12_TESTE.xls but the values looks like as txt file.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

I happen to prefer using the excel engine.  However, you may be able to accomplish what you need by using the ExcelXP tagset.  Take a look at: http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html

View solution in original post

10 REPLIES 10
art297
Opal | Level 21

I happen to prefer using the excel engine.  However, you may be able to accomplish what you need by using the ExcelXP tagset.  Take a look at: http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html

Augusto
Obsidian | Level 7

Mr. art

To do exports to excel do I need to have SAS/ACCESS?

art297
Opal | Level 21

Not with the tagsets

Augusto
Obsidian | Level 7

Hi Mister Art. I have a question regarding to tagsets.excelxp. When i run the second code below, the first sheet1 doesn't appear in the want.xls file, I mean is overwrited by the second execution. Is the a way to insert datas into many sheets using tagsets.excelxp? I do need to have more than one ods tagsets command because each one is belongs to its proccess.


ods tagsets.excelxp file = "c:\want.xls"  options (sheet_name = 'sheet1');

     proc print data = have1 noobs;

     run;

ods tagsets.excelxp close;

ods tagesets.excelxp file = "c:\want.xls" options (sheet_name = 'sheet2');

  proc print data = have2 noobs;

  run;

ods tagsets.excelxp close;

art297
Opal | Level 21

Augusto: try it after commenting out the first close statement.  i.e.:

ods tagsets.excelxp file = "c:\art\want.xls"  options (sheet_name = 'sheet1');

     proc print data = sashelp.class noobs;

     run;

*ods tagsets.excelxp close;

ods tagesets.excelxp file = "c:\art\want.xls" options (sheet_name = 'sheet2');

  proc print data = sashelp.class noobs;

  run;

ods tagsets.excelxp close;

BTW, It is either Dr. Art or just Art.  "Mister" makes me feel to old Smiley Happy

Augusto
Obsidian | Level 7

Hi Dr. Art.

Well, I guees..I am in trouble, because actually I have these codes separated each one in its process. not like I've shown here. I have one process called export_data1.sas and other export_data2.sas that must be processed separated and the results are exported to the same excel in separated sheets.

art297
Opal | Level 21

Why not just save the resulting file from the first process as a permanent file then, when you run the second process, print both files?

Augusto
Obsidian | Level 7

I will do this. Is the only way.

Here in Brazil we usually call Mister those we think that have the power to know.Smiley Happy

Thanks Art

Augusto
Obsidian | Level 7

thanks art. you helped me again.

SASKiwi
PROC Star

Try changing the file extension from XLS to CSV. That way when you double click on the file in Windows Explorer Excel should recognise it as a delimited file.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1175 views
  • 0 likes
  • 3 in conversation