I basically want to delete a folder 'test_fldr' on ftp server, and can not because folder is not empty.
tried rcmd='rmd /Test/test_fldr' (folder not empty)
tried rcmd='rmd -r /Test/test_fldr' (invalid file name, apparently -r is not recognized)
problem:
so decided to delete files in the folder first, as you see in following code
rcmd='dele *.*' debug does not work.
%macro del_temp;
filename del ftp 'x' /* it doesn't work with empty ' ', so decided with x */
/* connect */
host='111.111.111.111'
user='abcd'
pass='YYYYYYYYYYY'
/* change directory */
cd='/Test/test_fldr'
rcmd='dele *.*' debug /* struck here: extrct from log "NOTE: <<< 550 *.*: The filename, directory name, or volume label syntax is incorrect. "
;
data _null_;
file del;
run;
%mend;
%del_temp
any help would be appreciated.
This is not a SAS issue. The ftp server is allowing some commands and there will be restrictions as of security on those files.
Try to find those and after that you could go on with the attempt using the SAS interfacing. (rcmd usage)
Concur with Jaap, also to add there is probably a very good reason why deleting things via ftp is not allowed! Even local file deletion should be undertaken with extreme caution, and backups.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.