Hi Chris, I was using the macro to loop through all the csv files, but I gave your way a shot. I didn't get any errors, but the files were still not deleted from the folder. data _null_;
45 do I=1 to &n;
46 FILENAME=cats("&path1",scan("&filename",I,'|'));
47 if ^fileexist(FILENAME) then continue;
2 The SAS System 22:48 Tuesday, July 23, 2019
48 RC=filename("StudyID",FILENAME);
49 if RC=0 then RC=fdelete("StudyID");
50 end;
51 RC=filename("StudyID");
52 run;
53
54 %end;
55
56 %end;
57 %mend;
58
59 %loop;
MLOGIC(LOOP): Beginning execution.
MLOGIC(LOOP): %IF condition &n is TRUE
MLOGIC(LOOP): %DO loop beginning; index variable I; start value is 1; stop value is 6; by value is 1.
MLOGIC(LOOP): %LET (variable name is FILEIN)
MLOGIC(LOOP): %PUT filein=&filein
filein=SUBJECT2930.csv
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
MLOGIC(LOOP): %DO loop index variable I is now 2; loop will iterate again.
MLOGIC(LOOP): %LET (variable name is FILEIN)
MLOGIC(LOOP): %PUT filein=&filein
filein=SUBJECT6782.csv
... View more