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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 600 views
  • 0 likes
  • 2 in conversation