BookmarkSubscribeRSS Feed
amylanza
Calcite | Level 5

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.

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Variable order should not matter.

--
Paige Miller
ballardw
Super User

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. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 3455 views
  • 3 likes
  • 3 in conversation