DATA Step, Macro, Functions and more

PROC DATA_COMPARE .. Data set comparison

Reply
Contributor
Posts: 20

PROC DATA_COMPARE .. Data set comparison

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 

 

Trusted Advisor
Posts: 1,555

Re: PROC DATA_COMPARE .. Data set comparison

Posted in reply to srinidelite

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...

Ask a Question
Discussion stats
  • 1 reply
  • 85 views
  • 0 likes
  • 2 in conversation