The X or SYSTASK statements should do the trick (as Doc@Duke suggests), however if you need more control to select certain types of files, try the FDELETE function. This function will delete any type of file, and since you are in the DATA step, this gives you a great deal of flexibility. For windows: filename list pipe 'dir "c:\temp\sasdat" /b/o'; data _null_; length fname $40; infile list truncover; input fname $; rc=filename('abc',catt("c:\temp\sasdat\",fname)); if rc = 0 and fexist('abc') then rc=fdelete('abc'); rc=filename('abc'); run;
... View more