SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Akshaya_1397
Obsidian | Level 7

IMG_20230513_155816.jpgI need to compare two datasets A & B

A has a variable action_comments =length 8000 character variable

B has variable action_commebts=length 8000 character variable

While doing proc compare something gets wrong with the variable even though

The data is same in both.

 

Can anyone tell me help me getting wrong?

3 REPLIES 3
SASKiwi
PROC Star

If your PROC COMPARE does not include a BY or ID statement then SAS does a row-for-row comparison - row 1 with row 1, row 2 with row 2 etc. If your compare datasets contain identical data and the same number of rows, then check to see if your rows are in the same order or not. COMPARE could simply be reporting that the datasets do not have the same row order. 

Tom
Super User Tom
Super User

All of the values in your photograph look different to me.  Most of the values on the left have leading spaces.  Some of them even have differences in the actual letters.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1022 views
  • 1 like
  • 4 in conversation