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