Hi, I work on a project that gets data from different sources and provides a dataset of new cases on a daily bases. I import data from different excel sheets into SAS where I merge them and then clean and deduplicate them and create a dataset of new cases only. First, what function can I use to create the dataset? Also, is there a way to automate the creation of this dataset? Here's the SAS program that I use to create the daily data so far: %macro data(sheet, name); proc import out= &name replace datafile = "R:\Hospital-Outreach\Patient Safety Information Exchange\PSIE_Data\PSIEDataProcess\PSIE_DataToSAS.xlsx" dbms = Excel; sheet = "&sheet"; getnames = yes; run; %mend data; %data(inc, inc); %data(efc, efc); %data(lab, lab); %data(NHSN, NHSN); %data(LiveList, LiveList); proc contents data = efc; run; %MACRO MSORT1(DATASET,VAR); PROC SORT DATA=&DATASET; BY &VAR; RUN; %MEND MSORT1; %MACRO MMERGE(DEST,SOURCE1,SOURCE2,VAR); %msort1(&source1, &var); %msort1(&source2, &var); DATA &DEST; update &SOURCE1 &SOURCE2; BY &VAR; RUN; %MEND MMERGE; %MMERGE (WORK.labinc, WORK.Inc, WORK.lab, incident_ID); %MMERGE (WORK.IRIS, WORK.labinc, WORK.efc, person_ID); %MMERGE (WORK.All, WORK.IRIS, WORK.NHSN, Full_Name); /*Data deduplication for null addresses*/ proc sql; create table Alldup as select * from All group by full_name having Address1=max(address1) order by full_name, person_id, DOB; quit; Thank you
... View more