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
SAS Super FREQ
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
SAS Super FREQ
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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1866 views
  • 0 likes
  • 4 in conversation