Hello, if someone can please help
Four step process.
/*Step-1-working fine - creating sas dataset to list out number of files */
/*Getting list of the files from dir*/
data filenames; length fref $8 fname $200; did = filename(fref, '/woo/dir'); did = dopen(fref); do i = 1 to dnum(did); fname = dread(did,i); output; end; did = dclose(did); did = filename(fref); keep fname; run;
/*Step-2-working fine - creating macro variable based on number of value previous dataset has */
proc sql; select fname into: vars separated by ',' from work.filenames; quit;
/*Need help here for step-3 and step-4*/
/*step-3- want to transfer files into remote server using sftp command*/
%let localDir = '/woo/dir'; %let remoteDir = '/remote/woo/dir'; %let remoteServer = 'woo@remoteserver.com';
/*sftp command - but this should be for multiple files may be*/
%let sftp_cmd=sftp &remote_Server <<! put &local_file &remote_path quit !;
x "&sftp_cmd.";
/*step-4-send email notification if there are files and got transferred - if not, send email no file to transfer */
filename mymail email "woo@company.com"
subject="sales file transfer email"
to="woo@company.com";
data _null_;
file mymail;
put "x number of file transferred";
run;
... View more