BookmarkSubscribeRSS Feed
teckquan
SAS Employee

 Hi there,  I am trying to do some mathematics operation as below:

 

data XX;

set table; 

 

A= B*C/D

 

run;

 

 

B                    C           D  A
5000000.00 0.045000 2 *
5000000.00 0.045000 2 *

 

These are the logs for the operation. 

NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
127:53
NOTE: Variable A is uninitialized.
NOTE: Invalid character data, 112500.00 , at line 127 column 53.

 

Why does A change to character and how to stop it?

2 REPLIES 2
andreas_lds
Jade | Level 19

The first note "Numeric values have been converted to character values" indicates a problem during data import. Storing number in alphanumeric variables is not recommended. 

 

Are B, C and D numeric variables? If not: fix this first.

If A is not in dataset "table", add a length-statement.

 

teckquan
SAS Employee

Thanks for your reply. I fixed it with changing the IMPORT datatype of D from string to numeric. It was auto set to string as it is empty. 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 1085 views
  • 0 likes
  • 2 in conversation