Help using Base SAS procedures

How to FTP a ZIP file from a remote host to my local computer using SAS

Reply
N/A
Posts: 0

How to FTP a ZIP file from a remote host to my local computer using SAS

I'm trying to automate a current process we are running and would like to know how to ftp a zip file from a clients ftp site to my local hard drive using SAS code. Any help will be GREATLY appreciated!!!
N/A
Posts: 0

Re: How to FTP a ZIP file from a remote host to my local computer using SAS

Posted in reply to deleted_user
I found a work around using a .bat file if anybody is interested. It creates a table, exports it as a .bat file, and executes it. This worked good for me since my file is named with a date that changes every week.

DATA lib.table;
INPUT rem $ 1-50;
CARDS;
@echo off
cd\
d:
cd \directory
> my.ftp echo o ftp.address.com
>> my.ftp echo user
>> my.ftp echo password
>> my.ftp echo bin
>> my.ftp echo cd directory
>> my.ftp echo get file.zip
>> my.ftp echo quit
ftp -s:my.ftp
exit
;
RUN;

proc export data = lib.table
outfile = 'D:\directory\table.BAT'
dbms=tab;
run;

%sysexec D:\directory\table.BAT;
Ask a Question
Discussion stats
  • 1 reply
  • 191 views
  • 0 likes
  • 1 in conversation