Has anyone worked with CDC WONDER Multiple Causes of Death files and successfully merged datasets for multiple years (1999-2020)? I cannot figure out how to merge them after sorting.
https://communities.sas.com/t5/SAS-Programming/DUSMCPUB-files/m-p/863315/highlight/false#M341036
If you have SAS data sets you likely want to APPEND them, not Merge. Merge would be a side-by-side combination in SAS and makes no sense.
Proc Append base=Year1999 data=Year2000;
run;
will add Year 2000 to the end of the Year1999 data set. Repeat as needed.
If you want/need to manipulate the data while combining then you could use a data step such as
data want; set Year1999 - Year2020; /* other manipulation code goes here*/ run;
The append will execute faster, enough to be noticeable with largish files, because the data step approach reads each record so that it can be manipulated with all the overhead involved. Append moves blocks of data faster as it doesn't have any such concern.
If you have SAS data sets you likely want to APPEND them, not Merge. Merge would be a side-by-side combination in SAS and makes no sense.
Proc Append base=Year1999 data=Year2000;
run;
will add Year 2000 to the end of the Year1999 data set. Repeat as needed.
If you want/need to manipulate the data while combining then you could use a data step such as
data want; set Year1999 - Year2020; /* other manipulation code goes here*/ run;
The append will execute faster, enough to be noticeable with largish files, because the data step approach reads each record so that it can be manipulated with all the overhead involved. Append moves blocks of data faster as it doesn't have any such concern.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.