Help using Base SAS procedures

merging multiple datasets

Occasional Contributor
Posts: 16

merging multiple datasets

I am trying to concatenate 10 datasets with variables with same name but with diff.attributes.I tried to concatenate using proc append using force option .But its excluding some observations.How do i concatenate these 10 datasets into one dataset with all the observations present.

Super Contributor
Super Contributor
Posts: 3,176

Re: merging multiple datasets

A DATA step using a SET statement, possibly with a BY (presuming sorted input), however this process could also be problematic, if you attempt to combine / interleave observations using a BY but with a particular "truncated variable" condition, your prior "sorted input" may be compromised.

If you are not concerned about the possibility of truncation, you can concatenate and then sort. Or if you have concerns about truncation, consider coding SAS LENGTH or ATTRIB statements before the SET, so that you establish sufficient SAS variable length attribute so the DATA step processing can complete with desired success that meets your objectives for the final output.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation