BookmarkSubscribeRSS Feed
Sunboyss30
Obsidian | Level 7

Hi,

 

I am trying to compare two datasets in sas using proc compare. One of the character variable is not matching and shows difference however when i actual see the record the values are correct. They are defined as below in both base and comparing data set.

 

Base dataset --VARIABLE1  ;TYPE-Char   Len-16  Format-$16.  Informat-$16.

 

Comp dataset --VARIABLE1  ;TYPE-Char   Len-23  Format-$23.  Informat-$23.

 

Also, attached is the output for couple of records.

 

Thank in advance.

 

Regards,

3 REPLIES 3
Kurt_Bremser
Super User

To be sure, I'd add character variables of double length (eg 23 -> 46) and use put(...,$hex46.) format to convert the contents of your variables to hex notation. This allows detection of un-displayable characters or leading blanks.

Sunboyss30
Obsidian | Level 7

Hi,

 

Thanks for your reply. Actually the datasets are coming from two different databases Oracle and Teradata. And what if I dont want to change the format in the source datasets. Any other way of doing it.

 

Regards,

Kurt_Bremser
Super User

I'd be MASSIVELY surprised if you could ever get a solid match in SAS when comparing ORACLE and TERADATA, as it involves three different environments.

Pull the tables into SAS, run the compare, and then investigate the differences. This might give you clues what processes are necessary (during the import into SAS) to get the tables to a "common denominator".

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 681 views
  • 0 likes
  • 2 in conversation