BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
d6k5d3
Pyrite | Level 9
As a part of running a macro, I was just checking if there was any missing value, it would be deleted. Since the dataset doesn't have any missing value, it should return all the rows. Instead, I get this weird note which says "Character values have been converted to numeric value...":
 
 
10694  data US_Summ;
10695  set US_Summ;
10696  if Event=. then delete;
10697  run;
NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      10696:4
NOTE: Invalid numeric data, Event='Business Inventories' , at line 10696 column 4.
Date=03/13/2007 Time=10:00:00.000 Day=Tue Region=United States Category=Economic Releases
Event=Business Inventories Period=Jan Surv_M=0.002 Surv_A=0.0016 SD=0.14 Actual=0.002 Prior=0
Revised=0.001 Last_Rev=0.001 Surprise=0 Code=US18 Diff=0 SD_A=0.0018388298 Surprise_A=0 Year=2007
_TYPE_=3 _FREQ_=10 YSD_A=0.0018135294 _ERROR_=1 _N_=1
NOTE: Invalid numeric data, Event='Business Inventories' , at line 10696 column 4.
Date=04/16/2007 Time=10:00:00.000 Day=Mon Region=United States Category=Economic Releases
Event=Business Inventories Period=Feb Surv_M=0.003 Surv_A=0.0025 SD=0.1 Actual=0.003 Prior=0.002
Revised=0.003 Last_Rev=0.003 Surprise=0 Code=US18 Diff=0 SD_A=0.0018388298 Surprise_A=0 Year=2007
_TYPE_=3 _FREQ_=10 YSD_A=0.0018135294 _ERROR_=1 _N_=2
… … … … … …
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
Date=10/15/2008 Time=10:00:00.000 Day=Wed Region=United States Category=Economic Releases
Event=Business Inventories Period=Aug Surv_M=0.005 Surv_A=0.0048 SD=0.25 Actual=0.003 Prior=0.011
Revised=0.007 Last_Rev=0.007 Surprise=-0.81 Code=US18 Diff=-0.002 SD_A=0.0018388298
Surprise_A=-1.087648254 Year=2008 _TYPE_=3 _FREQ_=12 YSD_A=0.0028230652 _ERROR_=1 _N_=20
NOTE: There were 3383 observations read from the data set WORK.US_SUMM.
NOTE: The data set WORK.US_SUMM has 0 observations and 23 variables.
NOTE: DATA statement used (Total process time):
      real time           0.12 seconds
      cpu time            0.09 seconds
 
Any clue where I went wrong???
1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

You check if event=. which means that you expect EVENT to be numeric, 

while it seems to be char type like (see log) Event='Business Inventories' .

 

Did you mean to check if event is missing/blank/empty ?Then check by if missing(event) then...

Or maybe you want to check another variable?

View solution in original post

5 REPLIES 5
Shmuel
Garnet | Level 18

You check if event=. which means that you expect EVENT to be numeric, 

while it seems to be char type like (see log) Event='Business Inventories' .

 

Did you mean to check if event is missing/blank/empty ?Then check by if missing(event) then...

Or maybe you want to check another variable?

d6k5d3
Pyrite | Level 9
Oh no! Yes, Event is CHAR. So I didn't know that if a variable like Event is CHAR, then I cannot write if Event=.!!! So in case of Event, I should write like: if Event=' ', right?
Astounding
PROC Star

That's correct.

d6k5d3
Pyrite | Level 9
Sorry, I accepted your post as a solution before receiving your reply.
Kurt_Bremser
Super User

Every time you see this:

NOTE: Character values have been converted to numeric values at the places given by:

it has to ring an alarm bell. Find the cause and remove it by implementing an explicit conversion, or make up your code so that it accomodates the variable types (what you are already doing).

Also see Maxim 25.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 788 views
  • 2 likes
  • 4 in conversation