Desktop productivity for business analysts and programmers

Batch Export to Excel

Reply
Occasional Contributor
Posts: 9

Batch Export to Excel

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.
SAS Super FREQ
Posts: 8,720

Re: Batch Export to Excel

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
Occasional Contributor
Posts: 9

Re: Batch Export to Excel

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.
SAS Super FREQ
Posts: 8,720

Re: Batch Export to Excel

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
Ask a Question
Discussion stats
  • 3 replies
  • 236 views
  • 0 likes
  • 2 in conversation