BookmarkSubscribeRSS Feed
R_Chung
Quartz | Level 8

Hello, everyone. I am using SAS Data Integration Studio - delete transformation.

 

This is my work flow:

source table(Table A) --> extract(Temp Table B) --> delete --> destination table(Table C)

 

First, I extract a field from the source table and suppose it will only yield one result, say id = 2.

 

Second, I make a setting (where clause) in the delete transformation block, C.id = B.id (which is 2 from Table A)

 

However, it always yields a result that ERROR: Expression using equals (=) has components that are of different data types.

 

I have checked the setting of both id of both table, also the temp table on extract transformation, in SAS, they are the same.

Meanwhile,

I have checked the setting of both id of both table in Database, they are also the same.

 

Could anyone suggest the problem for me?

 

Thankyou

 

 

5 REPLIES 5
LinusH
Tourmaline | Level 20
Obviously they aren't of the same data type. Be aware of that Metadata and physical data might not be on sync.
Data never sleeps
ballardw
Super User

I don't use DI so this may seem odd as a question. It appears to me that you are creating table C so where do you tell Table C what type of variable ID in table C may be? Your description makes it sound to me that you may be using a variable, C.id before it exists.

 

If you ID variable in Table A and B are both character it may be that table C thinks the variable should be numeric if not explicitly stated to be character somewhere prior.

 

Also you may want to consider this:

C.id = B.id (which is 2 from Table A)

is somewhat confusing. IF 2 is from Table A why are you calling it B.id or C.id? Since we do not have your actual data sets this looks very odd.

R_Chung
Quartz | Level 8

The table C is not created. It is a registered table.

Patrick
Opal | Level 21

@R_Chung

I assume you mean by "Registered Table" that the SAS Table Metadata object has been created based on an existing physical table. What that means: As long as you don't change the Metadata definition or recreate the underlying physical table with different attributes, SAS Metadata and Physical table attributes will be in sync.

 

If that's the case then ensure that your table used for deletion got the same attributes than your table C (both in metadata - and this can also be a green table - and in underlying physical table attributes.

Patrick
Opal | Level 21

@R_Chung

Make sure that the column metadata definitions of target table for node "extract(Temp Table B)" are exactly the same than what you have in "Table C".

 

Once Metadata is the same: 

If your node  "extract(Temp Table B)" doesn't always fully re-create the underlying physical SAS table (ie. a truncate and append) then make sure that you manually delete the physical SAS table (target table of node "extract(Temp Table B)") after you've changed the SAS metadata for this table.

 

SAS Metadata gets used for table creation. What can happen with processes that don't always re-create the physical table: You change a Metadata definition but as the underlying physical table doesn't get re-created, Metadata and physical data are no more in sync. On your DIS Metadata level everything looks o.k. but when you run the job then on the physical level column definitions might not yet be in sync and you get errors as the one you've just encountered. 

 

The safest way to avoid this: Delete the physical tables manually after changing column metadata so they get re-created based on the current SAS metadata definitions.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1919 views
  • 0 likes
  • 4 in conversation