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-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!

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.

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
  • 5 replies
  • 1338 views
  • 0 likes
  • 4 in conversation