BookmarkSubscribeRSS Feed
asheeshdhupper7
Fluorite | Level 6

i need help for MERGING two data sets with common data from both datasets.

Thanks in advance....

Asheesh

9 REPLIES 9
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Do the video training or a course?  If you have a specific question, then please start by formulating test data, in the form of a datastep which will illustrate what you are working with (just a few rows), then show the ouput you require, and provide any code you may already have tried (use the {i} above your post for code blocks).  All I can provide without any information is my usual graphic on joins (which can also be done just as well in datastep merge but I don't have the graphic for that):

Capture.PNG

Oligolas
Barite | Level 11

Hi,

 

Choose the join you need from the graphic below.

If you still need help consult

http://www.listendata.com/2014/04/proc-sql-select-statement.html 

https://www.youtube.com/watch?v=rF5DC3CPORc

https://www.youtube.com/watch?v=rIbdmdVdAgQ

or post a specific question with sample data.

 

Cheers

Visual_SQL_JOINS_orig.jpg

________________________

- Cheers -

asheeshdhupper7
Fluorite | Level 6

thanks for your answer..

but i need without proc SQL..

Regards, Asheesh

asheeshdhupper7
Fluorite | Level 6

can u please help me with MERGE statement.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

If your not going to provide any information then you wont get a useful answer.  Refer to the manual:

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202970.htm

BrunoMueller
SAS Super FREQ

Hi

 

I would take the free e-Learning SAS Programming 1: Essentials so you can learn all the basics about SAS programming. Lesson 10 will give information about different ways to combine tables.

 

Bruno

silvergrenade
Obsidian | Level 7
Hi Asheesh,
Use the following snippet to find a data merge in data step.

data test;
merge X(in=a) Y (in=b) Z (in=c);
by common_variable;
mi_ind=compress(a||b||c);
run;

The mi_ind would help you in determining from where the particular row is coming from
Oligolas
Barite | Level 11

...and remember btw that merge is not able to proceed a many-to-many relationship

 

Cheers

________________________

- Cheers -

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 4589 views
  • 4 likes
  • 5 in conversation