Learning SAS? Welcome to the exclusive online community for all SAS learners.

Error while using Proc SQL

Reply
Occasional Contributor
Posts: 17

Error while using Proc SQL

Hi Experts,

I am performing left join on 2 tables. I want to perform VLOOKUP for a column which I am applying using Left Join as per my requirement. Before the Left join, I have 1735 obs which is the correct number. Post the join I get 1736 obs, which is incorrect. I am not understanding as to how should I debug where is the error.

Please help.

Regards,

Gurpreet Kaur

Respected Advisor
Posts: 4,659

Re: Error while using Proc SQL

The error is likely the presence of a duplicate entry in your second (right) table. Try

proc sql;

select * from secondTable

group by ID

having count(*) > 1;

quit;

where ID is your join column, to identify the problem records in the second table.

PG

PG
Ask a Question
Discussion stats
  • 1 reply
  • 232 views
  • 0 likes
  • 2 in conversation