Good morning and happy hollydays:
well i have to go back into my research cause i noticed my self mistakes in my original data sets, due merging issues:
i have tried this:
data merged_data;
merge a2005 a2006 a2007a a2007b a2008 a2009 a2010a a2010b a2010c a2010c1 a2010c2 a2010c3 a2010c4 a2010c5 a2010c6 a2010c7 a2010c8 a2010c9 a2012a1 a2012a2 a2012a3 a2012a4 a2012a5 a2012a6 a2012a7 a2013a1 a2013a2 a2013a12 a2013a3 a2013a4 a2013a5 a2013a6 a2013a7 a2013a8 a2013a9 a2013a10 a2014 a2015;
by animal;
run;
but it stills get duplicating many data, this because exhaustively searched the duplicate in the excel and i didnt find this.
each data contains in one column called Animal, and the other(s) measurements.
Thank you very much for your help
To find duplicates across the files/years you can append them keeping only the key variables and the data source.
data stacked;
set a2005-a2015 indsname=datasource; *may need to explicitly list records or you can find some shortcuts using colon;
source=datasource;
keep animal source;
run;
proc sort data=stacked;
by animal source;
run;
*You expect 1 per file, but are getting multiples so you can see which years have multiples;
data dups;
set stacked;
if not (first.source and last.source) then output;
run;
To find duplicates across the files/years you can append them keeping only the key variables and the data source.
data stacked;
set a2005-a2015 indsname=datasource; *may need to explicitly list records or you can find some shortcuts using colon;
source=datasource;
keep animal source;
run;
proc sort data=stacked;
by animal source;
run;
*You expect 1 per file, but are getting multiples so you can see which years have multiples;
data dups;
set stacked;
if not (first.source and last.source) then output;
run;
proc sort data=sashelp.class out=duplicate nounikeys;
by age;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.