Desktop productivity for business analysts and programmers

merge - proc sql join

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

merge - proc sql join

Hi,

I usually use the data step below;

data test;

merge table_A (in=a) table_B (in=b);

by X Y;

if a and not b;

run;

Can I make the same result whit PROC SQL in Guide?

Any suggestions?

Many thanks


Accepted Solutions
Solution
‎01-30-2012 04:54 AM
Regular Contributor
Posts: 179

merge - proc sql join

Yes:

proc sql;

create table test as

   select    *

   from      a

   left join b

   on        a.x=b.x

   and       a.y=b.y

   where     b.y=''

  ;

quit;

You can use the code in a Program node or click it together using a Query task.

-Bart

View solution in original post


All Replies
Solution
‎01-30-2012 04:54 AM
Regular Contributor
Posts: 179

merge - proc sql join

Yes:

proc sql;

create table test as

   select    *

   from      a

   left join b

   on        a.x=b.x

   and       a.y=b.y

   where     b.y=''

  ;

quit;

You can use the code in a Program node or click it together using a Query task.

-Bart

Occasional Contributor
Posts: 12

merge - proc sql join

Thanks  very much!!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 146 views
  • 0 likes
  • 2 in conversation