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

Hi all 

 

I just want to know how to remove or create a missing value for this kind of numbers (115846255E5),  numbers that have letters that resulted from some calculations.

 

regards 

 

Ibrahim 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

@Barkamih wrote:

 

I'm looking only for a number less than 1000, so when i did that these numbers still in my dataset by using the following code:

 

If PDY  > 1000 then PDY = 0;


Are you saying that PDY=115846255E5 was not changed to 0 by your IF-THEN statement? If so, please post test data demonstrating this in the form of a DATA step and also your code. (Note that invalid numeric raw data values such as 1234K5 typically lead to numeric missing values, which are indeed evaluated as < 1000 in comparisons.)

 

Also, why would you change an "invalid" value (according to your definition) to an arbitrary valid value (0 is "a number less than 1000"), which has the potential to ruin subsequent analyses? I'd rather suggest to replace these exceedingly large values by a special missing value, e.g. .E, if this makes sense:

if PDY>1000 then PDY=.E;

View solution in original post

3 REPLIES 3
FreelanceReinh
Jade | Level 19

Hi @Barkamih,

 

As a numeric literal, 115846255E5=11584625500000. If this is the value of a numeric variable, it depends on the (arbitrary) choice of the display format if the formatted value contains a letter ("E"). So, without specifying a format your criterion "numbers that have letters" is not well-defined because numeric values as such don't contain letters. Also, you should have a good reason to remove a (possibly) valid numeric value (such as 11584625500000) from your data, in particular if it resulted from a calculation.

Barkamih
Pyrite | Level 9

thanks for this, 

 

Yes I have a reason to remove them, 

 

I'm looking only for a number less than 1000, so when i did that these numbers still in my dataset by using the following code:

 

If PDY  > 1000 then PDY = 0;

 

 

 

 

 

FreelanceReinh
Jade | Level 19

@Barkamih wrote:

 

I'm looking only for a number less than 1000, so when i did that these numbers still in my dataset by using the following code:

 

If PDY  > 1000 then PDY = 0;


Are you saying that PDY=115846255E5 was not changed to 0 by your IF-THEN statement? If so, please post test data demonstrating this in the form of a DATA step and also your code. (Note that invalid numeric raw data values such as 1234K5 typically lead to numeric missing values, which are indeed evaluated as < 1000 in comparisons.)

 

Also, why would you change an "invalid" value (according to your definition) to an arbitrary valid value (0 is "a number less than 1000"), which has the potential to ruin subsequent analyses? I'd rather suggest to replace these exceedingly large values by a special missing value, e.g. .E, if this makes sense:

if PDY>1000 then PDY=.E;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 679 views
  • 3 likes
  • 2 in conversation