Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Picture
Programming Tips 10


What if you don't sort the data sets prior to merging?

There will be an error message in the Log window and you won't be able to merge the data sets properly.

Example
Picture
Data set: DS1
Picture
Data set: DS2

The DS1 data set is not sorted by the merging variable (group). 

Merging the two data sets without first sorting them by the merging variable will show an error message in the Log window.

Example

Data DS;
Merge DS1 DS2;
By group;
Run;
Picture

ERROR: BY variables are not properly sorted on data set WORK.DS1.

​Merging unsorted data sets is one of the most common mistakes made by SAS beginner. Make sure you sort the data sets prior do merging any data sets!
Okay. Got it!
Already a member? Go to member's area.