BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buechler66
Barite | Level 11

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

4 REPLIES 4
ballardw
Super User

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.

ballardw
Super User

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.

buechler66
Barite | Level 11
Thanks for taking the time to help. Much appreciated.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 11395 views
  • 7 likes
  • 3 in conversation