I am reading in all of the XML files within a folder using the XMLV2 engine, and updating a dataset with the data contents of the files. After the update I run a macro which moves the XML files from the folder they are read in from to an archive folder. See code below: Filename ReadIn Temp; Libname ReadIn XMLV2 "&Exports.\&FileName." automap=replace xmlmap=ReadIn; Proc Copy In=ReadIn Out=Work; Run ; ... /* Update Dataset */ ... %Macro Archive; Options NoXWait; Data _Null_; Set File_List Nobs=Nobs; Call Symput('Nobs',compress(Nobs)); Run ; %Do i=1 %To &Nobs.; Data _Null_ ; Set File_List; If _N_=&i. ; Call Symput('Name',compress(Name)); Run ; %Put Moving File &i. of &Nobs. - "&Name." to "&Exports.\Archive\&Name."; X Move "&Exports.\&Name." "&Exports.\Archive\&Name." ; %End ; %Mend ; %Archive ; This process works without errors, but when archiving the files a few of them are not moved. If I close and reopen SAS and run the same code it works fine, so I am thinking the files are not being released after they are imported. Any ideas on how to release the files so they are free to be moved?
... View more