Help using Base SAS procedures

SAS FTP Upload

Frequent Contributor
Posts: 117

SAS FTP Upload

Hi All, I have a question around SAS and FTP:

Currently I have a set of reports generated by SAS (let's assume PDF's, EXCEL etc) in a directory (let's assume called 'report')

Is there any code I can add which can do the following:

1. Connect to my FTP/SFTP server

2. Upload the directory I specify from my system -> to a directory I specify on the FTP server.

Please provide sample code if possible!

Thank You!

Super Contributor
Posts: 578

Re: SAS FTP Upload

SAS has a FTP option for defining filenames.  Might be easier to send already created objects via batch file which SAS can also run.

New Contributor
Posts: 2

Re: SAS FTP Upload

use the code below

options  mlogic mprint obs=max formdlim='_'  source2 noxsync noxwait source=1;

%let id=user;

%let pw=xxxxxx;

data null;

file 'F:\Batch\getDATA.bat'; * the batch file;

put "ftp -s:%0";

put "goto END";

put "open"; /*Host name*/

put "&id";

put "&pw";

put 'CD "USer/Test/file"';/* FTP path*/

put "LCD C:\Users\dwnld";/* Local Destination path*/

put "GET abcd.txt";/* File name*/

put "bye";

put ":END";


options noxsync noxwait;

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation