Hello everyone,
I have a sample report as below. My purpose is to download the xml or xlsx file in my local PC from the server. I found Chris Hemedinger’s blog post on the internet but I couldn’t find the “Copy Files” task on Enterprise Guide 5.1 and he also showed for “Proc Export” procedure, I’m not sure whether “ods tagsets.ExcelXP” will work or not. I export the xml file as the following path on the server. “sas9/sasdata/....../Example.xml”. I can see the file on Enterprise Guide but I can’t open or copy to my Local PC from the server. I'd like to state that I have to use the “ods tagsets.ExcelXP”.
Chris Hemedinger’s post : http://blogs.sas.com/content/sasdummy/2013/05/20/export-and-download-any-file-from-sas-enterprise-gu...
ods html(id=1) file='server path' style=htmlblue
options(page_break='no');
ods msoffice2k(id=2) file='server path' style=htmlblue
options(page_break='no');
ods tagsets.excelxp(id=3) file='server path' style=htmlblue
options(embedded_titles='no' sheet_interval='none' sheet_name='AllGroups');
ods excel(id=4) file='server path' style=htmlblue
options(embedded_titles='no' sheet_interval='none' sheet_name='AllGroups');
proc sort data=sashelp.shoes out=shoes;
by region subsidiary product;
where product in ('Sandal' 'Boot' 'Slipper') and
region in ('Asia', 'Pacific', 'Canada');
run;
** starting program;
proc report data=shoes
style(summary) = Header;
title '1) Without extra columns';
where product in ('Sandal' 'Boot' 'Slipper');
column region subsidiary product,(sales returns calc);
define region /group;
define subsidiary / group;
define product / across;
define sales /sum f=dollar12.;
define returns / sum f=dollar12.;
define calc / computed f=dollar12.;
break after region / summarize;
compute after region;
region = 'Sum';
line ' ';
endcomp;
compute calc;
_c5_ = _c3_ - _c4_;
_c8_ = _c6_ - _c7_;
_c11_ = _c9_ - _c10_;
endcomp;
run;
ods html(id=1) close;
ods msoffice2k(id=2) close;
ods tagsets.excelxp(id=3) close;
ods excel(id=4) close;
title;
options byline;
Thank you.
The custom task you need is linked from this blog post. A few simple steps to download, copy to a special folder on your PC, and then EG can find the task.
The custom task you need is linked from this blog post. A few simple steps to download, copy to a special folder on your PC, and then EG can find the task.
You can also try a file transfer program like WinSCP.
Unfortunately, I cannot use WinSCP, MobAxterm,Fillazilla, etc. because I'm working on customer place as an end user. They don't let us.
I tried to do Chris Hemedinger's method in my local and I could succeed, if there are no suggestions, I'm going to try this method on customer environment, and accept Chris response as a solution
What about FTP? That command is part of Windows and Unix operating systems so you don't need to install anything. Its not as friendly as @ChrisHemedinger's solution though.
Do you mean FTP code in SAS like following link?
http://support.sas.com/kb/43/962.html
Can I pull the file by using SAS code?
Thanks
To use FTP in SAS code you would need to be able to FTP from your SAS server to your PC. You need to find out the IP address or host name of your PC as the first step.
Then, as a next step, you would need to be able to enable/start an FTP server on your local PC. That's an unusual thing to do on most workstations -- and might not be permitted in a tightly controlled IT environment.
Not that I'm rooting for my own answer here (and the Copy Files task), but I know that if you decide to go with that, you'll be in good company. Hundreds of other users now rely on that task -- and probably many more that I haven't heard from...
Okay, Mr. Hemedinger,
I'm agree with you, your method is best solution according to current circumstances.
Thank you very much 🙂
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.