Hello everyone The following SAS code which is to move a xlsx file to a zip file works perfectly, filename xfile "y\test.xlsx" recfm=n;
filename zfile zip "y\archive\Processed.zip" member="test.xlsx" recfm=n;
data _null_;
rc=fcopy('xfile','zfile');
put rc=;
rc=fdelete('xfile')
run; However, there are multiple xlsx files in the same directory need to be moved to the zip file. I put the above code in a Macro, but the filename statement not working in a Macro. %macro zip (file_name=); filename xfile "y\&file_name..xlsx" recfm=n; filename zfile zip "y\archive\Processed.zip" member="&file_name..xlsx" recfm=n; data _null_; rc=fcopy('xfile','zfile'); put rc=; rc=fdelete('xfile'); run; %mend; data _null_; set files; call execute('%nrstr(%zip(file_name='||strip(file_name)||'))'); run; Can you please advise how to modify the second SAS code. Thank you in advance
... View more