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

Hello,

I'm trying to get that

 

abCopt
Tom5245678
Titi88 

 

 

But my code does not work:

Here is my code and my tables

 

 

 

Data employee;
input a $ b;
datalines;
Tom 52
Titi 88
;
run;


Data portefeuille;
input b Copt D;
datalines;
52 45671 201929
52 45678 201930
56 45897 201930

;
run;

 

proc sql;
create table comp as
select emp.*,Port.Copt
from employee as emp left join portefeuille as Port on Port.b=emp.b
where Port.D = 201930;
quit;

 

 

 

Thanks for your help

 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

Use AND

 

from employee as emp left join portefeuille as Port on Port.b=emp.b
and Port.D = 201930;

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

Use AND

 

from employee as emp left join portefeuille as Port on Port.b=emp.b
and Port.D = 201930;
WilliamB
Obsidian | Level 7
Thank you so much. Have a good day

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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