BookmarkSubscribeRSS Feed
vomer
Obsidian | Level 7

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!

2 REPLIES 2
DBailey
Lapis Lazuli | Level 10

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

Subrata_LS
Calcite | Level 5

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 something@abcd.com"; /*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";

run;

options noxsync noxwait;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1052 views
  • 0 likes
  • 3 in conversation