Hello! I would like to create a macro that will automate searching through several folders. I will have multiple reports, therefore multiple folders with datasets. I would like to create a macro where it searches each folder(each folder represents metrics for a specific report), and in each dataset, look to see if it contains a specified column. If at least 1 of the datasets includes the column, then I want my macro to include my row-level-security column (created in a previous step) in all the datasets for that report. If at least 1 does not, then do not insert the column in any dataset for that report So far, for testing, this is what I have. I am still learning and I apologize if my code or what I am trying to accomplish isn’t clear. Thank you! Data contents_all; format empname $32.; stop; run; Proc contents noprint data= MetricFolder1. Dataset1 memtype=view out=contents (keep=empname); run; Proc append base=contents_all data=contents; run; Proc contents noprint data= MetricFolder1. Dataset2 memtype=view out=contents (keep=empname); run; Proc append base=contents_all data=contents; run; %global test; Data _null_; Set contents_all; If rls_name=’empname’ then do; Call (symput(‘test’,’Y’); Stop; End; Run; Each report lives under a main report folder, but the number of datasets under each subfolder could be different Metrics Folder <-main folder for reports MetricFolder1 <- Data for Report A Dataset1 Dataset2 Dataset3 MetricFolder2 <- Data for Report B Dataset1 Dataset2 Dataset3 Dataset4 MetricFolder3 <- Data for Report C Dataset1 Dataset2
... View more