Desktop productivity for business analysts and programmers

Does variable order matter with proc append?

Reply
New Contributor
Posts: 3

Does variable order matter with proc append?

I have 2 datasets with the exact same variables but a slightly different order. I want to combine these 2 datasets but am not sure if the variable order matters when using proc append.

 

If the variable order does matter, what are my options for combining the 2 datasets correctly without having to reorder the columns? There are a lot of columns so reordering would take a lot of time.

Respected Advisor
Posts: 3,288

Re: Does variable order matter with proc append?

Variable order should not matter.

--
Paige Miller
Super User
Posts: 13,942

Re: Does variable order matter with proc append?

Order shouldn't matter.

What will matter are variable types: variable x in the base set has to be the same type, numeric or character in both sets.

If the variable is character length might have an effect and will generate error messages and might require the FORCE option. The BASE data set length will be maintained in that case so stuffing 18 characters into 3 likely results in truncated (read: incomplete) data for those variables.

 

A variable in the base set may be missing in the appended data and generate a warning. A variable in the appended data that does not exist in the base data will generate and Error. Force will allow appending the data but the new variable(s) will not be added to the set. 

Ask a Question
Discussion stats
  • 2 replies
  • 148 views
  • 3 likes
  • 3 in conversation