BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GN0001
Barite | Level 11

Hello team,

 

Can someone tell me how to do joins (Left Outer Join, Inner Join) in SAS without using SQL?

 

Regards,

GN

Blue Blue
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
  You will learn about SAS and the MERGE statement in the Programming 2 course. Are you in Programming 1 or Programming 2? The question you asked previously was in relation to the Programming 1 class. Are you working in Programming 1 in the Lesson on SQL? If so, what example are you asking about?

 

  If you're just curious, here are some resources you might find enlightening:

https://support.sas.com/resources/papers/proceedings09/036-2009.pdf

https://support.sas.com/resources/papers/proceedings12/251-2012.pdf

https://www.lexjansen.com/nesug/nesug08/ff/ff03.pdf


Cynthia

View solution in original post

9 REPLIES 9
Cynthia_sas
SAS Super FREQ

Hi:
  You will learn about SAS and the MERGE statement in the Programming 2 course. Are you in Programming 1 or Programming 2? The question you asked previously was in relation to the Programming 1 class. Are you working in Programming 1 in the Lesson on SQL? If so, what example are you asking about?

 

  If you're just curious, here are some resources you might find enlightening:

https://support.sas.com/resources/papers/proceedings09/036-2009.pdf

https://support.sas.com/resources/papers/proceedings12/251-2012.pdf

https://www.lexjansen.com/nesug/nesug08/ff/ff03.pdf


Cynthia

GN0001
Barite | Level 11
Hello Cynthia,
I needed it and somehow due to some curiosity.
I don't know if I can learn programming 2 for free. The e-learning used to
have 11 sessions.

Respectfully,
Guity

Blue Blue
Cynthia_sas
SAS Super FREQ
Hi:
We revised Programming 1 and Programming 2 several years ago. The old version of Programming 1 with 11 chapters is no longer in sync with the certification exam. You should focus on the new version of Programming 1 and Programming 2. The old version of Programming 2 was also revised. Even if you can't take Programming 2 for free, you can get the Practice Exam for free and you can use the newest Prep Guide to prepare for the certification exam or study Programming 1 and Programming 2 concepts in a condensed form.
Also many countries have discounts for students. In the US, we have discounts for students and veterans and active military; in addition some companies have training discounts.
And, if none of that works out, you can look for papers on the topics covered in Programming 2 such as: functions, formats, do loops, merge, retain, SUM statement, BY Group processing, output control, such as described here: https://support.sas.com/edu/schedules.html?ctry=us&crs=PROG2#s1=3 .

Hope this helps,
Cynthia
GN0001
Barite | Level 11

Hello Cynthia,

This is a very good source. Thanks for sharing.

GN

Blue Blue
Reeza
Super User

Inner

data innerJoin;
merge table1 (in=A) table2 (in=B);
by ID:

if A & B;

run;

Outer Left Join

data outerLeft;
merge table1 (in=A) table2 (in=B);
by ID;

if A;
run;

@GN0001 wrote:

Hello team,

 

Can someone tell me how to do joins (Left Outer Join, Inner Join) in SAS without using SQL?

 

Regards,

GN


 

GN0001
Barite | Level 11
Hello Reeza,

Thanks for the response!
What determines the left join or inner join?

if A & B?

I appreciate your response.

Respectfully,
Guity


Blue Blue
Reeza
Super User
Yes. If you're studying for the certification exams, I highly recommend reading through this section of the documentation. It's a great overview on the various ways to 'combine' files.

https://documentation.sas.com/?docsetId=lrcon&docsetTarget=p0sz8gq6nvzcojn13pcqe3twvg1d.htm&docsetVe...
GN0001
Barite | Level 11
Thanks,
I will if I want to go deeper into it.
Guity
Blue Blue
GN0001
Barite | Level 11

Hello Reeza,

I already have a certificate. I have not used SAS in the job market. I am refreshing my knowledge. 

Regards,

Guity

Blue Blue

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 1195 views
  • 7 likes
  • 3 in conversation