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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1698 views
  • 0 likes
  • 4 in conversation