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


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.

1 ACCEPTED SOLUTION

Accepted Solutions
Haikuo
Onyx | Level 15

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

5 REPLIES 5
Reeza
Super User

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?

mrug12
Calcite | Level 5

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

acual variableas are firstname, lastname and date of birth.


Reeza
Super User

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

Haikuo
Onyx | Level 15

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

mrug12
Calcite | Level 5

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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