BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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!!!
1 REPLY 1
deleted_user
Not applicable
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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 1103 views
  • 0 likes
  • 1 in conversation