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

Hi,

 

I am doing a char to numeric conversion, but I am getting one note in my log that says:

 

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
6232:23

 

I don't have this many lines or columns in my data set.  I also don't see any character values that would generate this note.  I did a proc freq on all the variables I am converting.  Is there any way to specifically identify which value this is pointing to?  I have no idea what the 6232:23 is (i have 3504 rows and 14 columns).  I know it's not a big deal, but I can't have any conversion notes in my log.

 

Here is some of code:

 

length results $100.;
format range $4.;
siresult1=input(siresult,best.);
SINORMLO1=input(SINORMLO,best.);
SINORMHI1=input(SINORMHI,best.);
if siresult1^=. then do;
if siresult1< SINORMLO1 then Range='L';
if siresult1>SINORMHI1 then Range='H';
if SINORMLO1<SIRESULT1<SINORMHI1 then Range='';
results=catx(", ",put(siresult1,8.1), range);
end;
else if siresult1='' then do;
results='';

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

The line numbers refer to the numbers in the log. 

CHECK YOUR LOG. And post it.

View solution in original post

4 REPLIES 4
Reeza
Super User

The line numbers refer to the numbers in the log. 

CHECK YOUR LOG. And post it.

ChrisNZ
Tourmaline | Level 20

The numbers are the position in the log.

Here line #27 column # 5.

 

25 
26 data T;
27 A='1'+1;
28 run;

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
27:5 
NOTE: The data set WORK.T has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):

 

ballardw
Super User

In your code snippet:

if siresult1^=. then do;  <= siresult is numeric
 if siresult1< SINORMLO1 then Range='L';
 if siresult1>SINORMHI1 then Range='H';
 if SINORMLO1<SIRESULT1<SINORMHI1 then Range='';
 results=catx(", ",put(siresult1,8.1), range);
 end;
 else if siresult1='' then do;  <= here you are treating siresult as character

Us the function MISSING:

 

else if missing(siresult) then do ...

OR compare to the missing value

else if sirresult = . then do

 

Use of missing is a better option as that is one of the functions that works with both numeric and character values. Also it makes the code a bit easier to understand.

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
  • 4 replies
  • 865 views
  • 0 likes
  • 4 in conversation