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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2723 views
  • 0 likes
  • 3 in conversation