Hi.
I have two datasets...FinalData01234 and FinalData02360 that I want to Proc Append together into a ds named FinalData. Each of these datasets have Proc Transposed data where date values have become column names (e.g. _05_08_2016). I have no trouble appending FinalData01234 to FinalData because FinalData doesn't exist yet so it creates it using the data in the ds FinalData01234.
However, when I append the second ZIP Code specific ds named FinalData02360 it has column names that didn't exist in FinalData01234 (e.g. _05_09_2016). When this happens I get errors of the type below. How can I get these new column names to append without erroring?
Any help would be greatly appreciated.
NOTE: Appending WORK.FINALDATA02360 to WORK.FINALDATA.
WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not be added to the BASE file.
WARNING: Variable _03_25_2016 was not found on BASE file. The variable will not be added to the BASE file.
WARNING: Variable _01_06_2016 was not found on BASE file. The variable will not be added to the BASE file.
WARNING: Variable _12_08_2015 was not found on BASE file. The variable will not be added to the BASE file.
WARNING: Variable _12_03_2015 was not found on BASE file. The variable will not be added to the BASE file.
WARNING: Variable _11_27_2015 was not found on BASE file. The variable will not be added to the BASE file.
You'll be better off using a datastep and SET. Append does not allow adding new variables to the base dataset.
Or combine the input datasets and then transpose after the append.
You may find you data set with dates as variable names a continuing maintenance issue.
You'll be better off using a datastep and SET. Append does not allow adding new variables to the base dataset.
Or combine the input datasets and then transpose after the append.
You may find you data set with dates as variable names a continuing maintenance issue.
proc append base=A data=B force nowarn;
run;
Remember:
If the DATA= data set contains variables that are not in the BASE= data set, use the FORCE option in the APPEND statement to force the concatenation of the two data sets. The APPEND statement drops the extra variables and issues a warning message. You can use the NOWARN option to suppress the warning message.
So if the goal is too add variables then Force option isn't what is needed.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.