BookmarkSubscribeRSS Feed
Kenny
Obsidian | Level 7
Can the EG Export to Excel be put in a batch job? I don't see any code generated, so I'm assuming it can't.
5 REPLIES 5
Cynthia_sas
Diamond | Level 26
Hi:
If you are exporting DATA (like SASHELP.CLASS) to Excel, then you can do that in a BATCH job using PROC EXPORT.

If you want to get your procedure RESULTS (the results of a PROC MEANS, for example) into Excel then you have 2 choices:
1) create an output data set from PROC MEANS and then EXPORT the data set with PROC EXPORT
or
2) use ODS HTML, ODS MSOFFICE2K or ODS TAGSETS.EXCELXP to create an output file that Excel can open and render in Worksheet form.

You may have to type code into a CODE node or otherwise set up the code to run as a batch job. There are many examples of this in the SAS documentation.

cynthia
Kenny
Obsidian | Level 7
Thanks,

I was trying to write it from a Linux server SAS dataset to a Windows share. I can use the csv DBMS, but then I still have to move the file to the Win platform.

Maybe I can shell out of SAS and run an FTP or something.
Cynthia_sas
Diamond | Level 26
Hi:
If you have SAS/Access to PC files, then you can use the LIBNAME engine for PCFILES in the manner shown here:
http://support.sas.com/documentation/cdl/en/acpcref/59619/HTML/default/a002644677.htm

with path=, port= and server= options. This should work in a batch job, as long as all the network widgets are working and connected when the batch job runs.

Otherwise, you may have to create the file as CSV with PROC EXPORT (or using ODS TAGSETS.EXCELXP or ODS HTML) and then move the file.

cynthia
nwitlou
Calcite | Level 5

Cynthia, i don't know if you are still working with SAS but i have the following problem:

we using SAS/AF - SAS9.4 on AIX in batch (ODS TAGSETS.EXCELXP ). after selecting data we want to export it into an excel file. we are using the code:

/* Load ole object */
hostcl=loadclass('sashelp.fsp.hauto');
/* Start excel application */
rc=hostcl._new(excelObj,0,'Excel.Application');

but after the hostclass is set the job stops while excecution the next command - start excel application, without a warning/error etc

it used to work, but we changed servers, ms excel (version 2013) and sas9.1 into sas9.4

did we miss some settings in excel/sas?

can you help us out?

why is the excel file not written?

this problem in only when we are using it within a batch job using automic 4.

Nicolet

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2480 views
  • 0 likes
  • 4 in conversation