I have a dataset with two variables: one is SSN and one is a unique study ID. I have an external folder of image files for each subject, and each image file is named by SSN. I would like to rename all external files from SSN to studyID. Following is the code that I tried, but I think I am missing a big step somewhere for making the macro part work. Thank you in advance!!! %MACRO rename (ssn, studyid); DATA _NULL_; SET data; IF FILEEXIST("L:\Projects\&ssn..docx") THEN DO; RC = RENAME ("L:\Projects\&ssn..docx", "S:\Projects\&studyid..docx", 'file'); END; RUN; %MEND; %RENAME (ssn, studyid);
... View more