BookmarkSubscribeRSS Feed
David_Billa
Rhodochrosite | Level 12

I want to multiply two numeric variables called value and factor to derive the variable 'new_value' in one (join) transformation . But when I multiply I got the error as mentioned in subject.

When I checked I see that both the variables are defined as numeric from source. But I'm not sure  why I get this error. 

Expression which I used is, new_value=value*factor.

When I run the automatic code from the transformation in SAS EG, I see that the variable 'factor' is character but in DI job I see that it's a numeric data type. Any help here identify the cause for this error?

 

Why the variable type differs between EG and DI Studio? 

 

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Show us the PROC CONTENTS on these two variables in yuour data set.


Show us the full complete unedited  LOG of the data step code that you are using.

--
Paige Miller
Tom
Super User Tom
Super User

Most likely because the EG steps/code is using a different dataset than the DI steps/code is using.

 

David_Billa
Rhodochrosite | Level 12
I took the same code which was being used in DI to EG.
Reeza
Super User

Does that code include an import step? If so, and the import is PROC IMPORT or an automated import task that doesn't specify data types explicitly is why you'd get different answers. When you use a guessing procedure the risk is that the guesses could be different in different applications such as EG versus DI versus R/Python. 

David_Billa
Rhodochrosite | Level 12
No import in my code
ErikLund_Jensen
Rhodochrosite | Level 12

Hi @David_Billa 

In DI Studio you see the metadata entries for column definitions. It is a "normative" description, and in the best of all worlds the physical data set is created with the same attributes. But this is not always the case. There might be different attributes or even different variables present. It depends on the code that created the table,

 

Try to update metadata on the table in DI Studio (right click on the table and select "update metadata") and see what happens. If the column changes to character, you have found the problem and need to correct the error in the job that created the table.

 

If the variable is still numeric after update you are accessing two different tables in DI Studio and EG, like pointing to a development library in DI Studio and a production library in EG or vice versa.

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 2286 views
  • 2 likes
  • 5 in conversation