BookmarkSubscribeRSS Feed
LanMin
Fluorite | Level 6

Dear all,

I have a character variable SIC with some missing values. I used the script (see below) to eliminate those observations and the sas log says "Character values have been converted to numeric values at the places given by...:"

IF SIC=" " THEN DELETE;

My question: do I need to convert SIC into numeric before using  IF SIC=" " THEN DELETE;

thanks,

Lan

5 REPLIES 5
PGStats
Opal | Level 21

If SIC really is a character variable then the note refers to another statement. - PG

PG
Jagadishkatam
Amethyst | Level 16

i agree with PG,

The chances of note mentioned will arise when the sic variable data is character and you are considering it as numeric data while deleting. something like below

if sic=. then delete. However as per your post, it is a character and you have used the right statement.

Check if there are any other variable which is character and you are trying to delete those records considering the data is numeric.

Thanks,

Jagadish

Thanks,
Jag
ballardw
Super User

The log should have reported line numbers and number of times. Look at the code with that line number in the log.

I'll bet you've done a numeric function such as adding, subtracting or mulitplying with a variable you thought was numeric but is actually character.

jaredp
Quartz | Level 8

Could it also be that SAS is trying to convert the non-blank values in SIC?

LanMin
Fluorite | Level 6

Thanks to everyone who replied to my post !!!

SIC was numeric. my mistake. I changed the code  IF SIC=. THEN DELETE; it works.

-Lan

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
  • 5 replies
  • 3012 views
  • 1 like
  • 5 in conversation