BookmarkSubscribeRSS Feed
srinidelite
Obsidian | Level 7

Hi All  ,

 

I would like create a customised report by comparing two data set ..

 

Example consider the below two data sets SOURCE and TARGET .. All i wanted to achieve is produce a report on mismatch value by using primary key 

 

SOURCE     
     
PRIMARY_KEYValue1Value2Value3Value4
20012423.643.553.9627.6
20012525.73.864.3130.01
20012625.73.864.3130.01
20012734.265.145.7440
     
TARGET    
     
PRIMARY_KEYValue1Value2Value3Value4
20012423.643.553.9627.89
20012525.73.864.3130.23
20012678.23.8614.830.01
20012734.265.145.7440
     

 

REPORT LIKE BELOW 

------------------------------

 

PRIMARY_KEY_SourcePRIMARY_KEY_TargetCompareValue1_SourceValue1_TargetCompare(1)Value2_SourceValue2_TargetCompare
200124200124TRUE23.6423.64TRUE3.553.55TRUE
200125200125TRUE25.725.7TRUE3.863.86TRUE
200126200126TRUE25.778.2FALSE3.863.86TRUE
200127200127TRUE34.2634.26TRUE5.145.14TRUE

 

 

I tried using PROC_COMPARE however i don't know how to customise .. please can some one help me im very new to SAS programming 

 

1 REPLY 1
Shmuel
Garnet | Level 18

Proc compare will not create a report as you want, but have you tried:

proc compare base=source compare=target
             criterion=0.01;
        id primary_key;
run;

More options documented in

http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n0c1y14wyd3u7yn1dmfcp...

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 1 reply
  • 858 views
  • 0 likes
  • 2 in conversation