Desktop productivity for business analysts and programmers

Problem with Joint By proc sql. getting empty dataset.

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

Problem with Joint By proc sql. getting empty dataset.


I have 2 differentsas dataset.

A and B.

I am trying to get data from dataset A to dataset B as below

proc sql ;

create table c as select

a.11,

a.13,

a.14

from A,B

where

A.1=B.1 and A.2=B.2 and A.3=B.3;

quit;

Now I am getting empty dataset C.

I am sure I have values comman for 1,2 and 3 for A and B . I check formatting and  length in both dataset are same. Not sure why not getting records.


Accepted Solutions
Solution
‎11-27-2013 11:55 AM
Respected Advisor
Posts: 3,124

Re: Problem with Joint By proc sql. getting empty dataset.

For number variables , check their precision level; for char variables, you could be haunted by some invisible characters, to start, using LEFT and UPCASE(if you don't care about the case) to standardize your non-blank content,  then compare.

If you want to get to the bottom of it, hand pick some values you believe are the same, then put them into Hex. format, and check it out.

Good luck,

Haikuo

View solution in original post


All Replies
Grand Advisor
Posts: 17,342

Re: Problem with Joint By proc sql. getting empty dataset.

Did you code that or use the query tool? Does the query tool return results?

I wonder if your variables are actually 1/2/3?

Occasional Contributor
Posts: 19

Re: Problem with Joint By proc sql. getting empty dataset.

i code it my self . i even try with query tool but geeting same result.

acual variableas are firstname, lastname and date of birth.


Grand Advisor
Posts: 17,342

Re: Problem with Joint By proc sql. getting empty dataset.

Post the actual code please and log...there are many ways this could be happening.

Solution
‎11-27-2013 11:55 AM
Respected Advisor
Posts: 3,124

Re: Problem with Joint By proc sql. getting empty dataset.

For number variables , check their precision level; for char variables, you could be haunted by some invisible characters, to start, using LEFT and UPCASE(if you don't care about the case) to standardize your non-blank content,  then compare.

If you want to get to the bottom of it, hand pick some values you believe are the same, then put them into Hex. format, and check it out.

Good luck,

Haikuo

Occasional Contributor
Posts: 19

Re: Problem with Joint By proc sql. getting empty dataset.

Thanks for the help. it turn out to be problem with case of char veriables.

☑ This topic is SOLVED.

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

Discussion stats
  • 5 replies
  • 242 views
  • 2 likes
  • 3 in conversation