DATA Step, Macro, Functions and more

sql join with different values in different cases

Accepted Solution Solved
Reply
Regular Contributor
Posts: 182
Accepted Solution

sql join with different values in different cases

Hi all,

 

I'm trying to do a left join with values of variables in the two tables in different cases.  I am getting a error when trying to do the upcase in the where statement.  

 

proc sql;
create table final as
select a.*, b.LBTO
from allx as a left lbx as b
on a.id=b.id where a.upcase(test)=b.upcase(test) and a.upcase(visit)=b.upcase(visit);
quit;

 

help appreciated!


Accepted Solutions
Solution
‎01-15-2018 12:54 PM
Super User
Posts: 23,776

Re: sql join with different values in different cases

The alias always goes with the variable, you've applied it to the function. 

 

Change b.upcase(Test) => upcase(b.Test)

 


View solution in original post


All Replies
Solution
‎01-15-2018 12:54 PM
Super User
Posts: 23,776

Re: sql join with different values in different cases

The alias always goes with the variable, you've applied it to the function. 

 

Change b.upcase(Test) => upcase(b.Test)

 


Regular Contributor
Posts: 182

Re: sql join with different values in different cases

Thank you!
☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 168 views
  • 3 likes
  • 2 in conversation