DATA Step, Macro, Functions and more

please help in inner join

Reply
New Contributor
Posts: 3

please help in inner join

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

Thanks in advance....

Asheesh

Super User
Super User
Posts: 7,997

Re: please help in inner join

Posted in reply to asheeshdhupper7

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

Frequent Contributor
Posts: 129

Re: please help in inner join

[ Edited ]
Posted in reply to asheeshdhupper7

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 -

New Contributor
Posts: 3

Re: please help in inner join

thanks for your answer..

but i need without proc SQL..

Regards, Asheesh

New Contributor
Posts: 3

Re: please help in inner join

Posted in reply to asheeshdhupper7

can u please help me with MERGE statement.

Frequent Contributor
Posts: 129

Re: please help in inner join

[ Edited ]
Posted in reply to asheeshdhupper7
Super User
Super User
Posts: 7,997

Re: please help in inner join

Posted in reply to asheeshdhupper7

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

SAS Super FREQ
Posts: 709

Re: please help in inner join

Posted in reply to asheeshdhupper7

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

Occasional Contributor
Posts: 11

Re: please help in inner join

Posted in reply to asheeshdhupper7
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
Frequent Contributor
Posts: 129

Re: please help in inner join

Posted in reply to silvergrenade

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

 

Cheers

________________________

- Cheers -

Ask a Question
Discussion stats
  • 9 replies
  • 162 views
  • 4 likes
  • 5 in conversation