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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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