DATA Step, Macro, Functions and more

Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ...

Accepted Solution Solved
Reply
Regular Contributor
Posts: 212
Accepted Solution

Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ...

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.

 


Accepted Solutions
Solution
‎07-12-2016 10:14 PM
Super User
Posts: 10,516

Re: Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ..

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.

View solution in original post


All Replies
Solution
‎07-12-2016 10:14 PM
Super User
Posts: 10,516

Re: Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ..

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.

Super User
Posts: 9,682

Re: Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ..

proc append base=A data=B force nowarn;
run;
Super User
Posts: 10,516

Re: Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ..

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.

Regular Contributor
Posts: 212

Re: Proc Append - WARNING: Variable _05_09_2016 was not found on BASE file. The variable will not ..

Thanks for taking the time to help. Much appreciated.
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 768 views
  • 2 likes
  • 3 in conversation