BookmarkSubscribeRSS Feed
Raj_C
Obsidian | Level 7

Hi SAS Users,

 

I want to compare two excel files which I have attached.

having Subject ID, VISITREFNAME Record identifier are the common variables in both excels.

unmatched data to be reported in new excel sheet with sas code.

 

Simple code will be highly appreciated.

 

Kind Regards,
Raju

5 REPLIES 5
Kurt_Bremser
Super User

- import tables into SAS

- sort by identifying key variables

- in a data step, MERGE the two tables by key variables, using the in= dataset option to identify contributing tables

- specify a condition, using the variables from the in= options

 

PS don't post example data in MS Office files. Nobody in his right mind opens such from the web.

Use a data step with data in a cards; block.

Abhi1212
Obsidian | Level 7

Hello Sir,

Could you please provide the complete code for comparing two excels ?

Kurt_Bremser
Super User

My consultant fee for doing other people's work is 100 € / hr.

 

Show what you've already done, provide data, and where your problem lies, to get hints for fixing it.

Abhi1212
Obsidian | Level 7

My two excel file has been imported. I am not sure about my next step of code..

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 3167 views
  • 0 likes
  • 3 in conversation