BookmarkSubscribeRSS Feed
vallsas
Pyrite | Level 9

HI,

I am creating the join by using the query builder where as my source tables both are directly reading from DB as one of the table join column is not matching (data type) with other table join column , where as i know eg programming while joining in proc sql we can convert to numeric(input) and join the tables  but here the problem is we are reading from db  in query builder and joining.The error saying data type not matching on the join column.

any ideas with out locally creating and coNverting the column , i want to do directly in query builder join even if data type is different .

3 REPLIES 3
ballardw
Super User

Are these two external tables from the same database? If so, my first feeling would be to talk to the data base administrator about why the types are different and see if the admin will provide a work around, such as view in the database that does the conversion and you can use that as your source.

 

If they are not from the same database it may be unreasonable to expect them to be of the same type(or properties) and a conversion somewhere will be needed. Again you may convince one of the database admins to make a conversion view of the needed data.

vallsas
Pyrite | Level 9
The both tables are from same database but as per the business they have created the data type as character in one table.So we need to handle at the analysis side and looking for best option without creating the temp table I would like to do in query builder only .I wonder that we can do by code without creating a temp table but not in query builder.
Kurt_Bremser
Super User

I doubt that the query builder allows a function to be applied before the join is defined. You either need two steps (define a view which does the conversion, then join), or you write the SQL yourself in a code node.

 

A business item (and one used for joining!) stored as a number in one table, and character in another? My word for this is "clusterfuck". Somebody needs to have their head examined for possible absence of a brain.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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