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 have got this issue when I run my code.

 

958,105 observations are not included because of missing values, and all observations are 1.1 million, in this case, a large number of data are not used in the analysis 

 

So, I did this code to fix this problem but still the same,  it is true the outputs are changed but the number of observation who are not used because of missing values still the same in the log 

 

data milk;
set milk;
if  a = . then a =' ';
if  b = . then b =' ';
if  c = . then c =' ';
if  p = . then p =' ';
if  peakyield = . then peakyield =' ';
run; quit;

 

 regards 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Your "fix" still leaves you with missing values.  What non-missing value could you substitute?  For example, would this make sense?

 

if a = . then a = 0;

View solution in original post

4 REPLIES 4
andreas_lds
Jade | Level 19

"but the number of observation who are not used because of missing values still the same in the log "

 

Used by what? Many procedures have option, often named "missing" to include observations having missing-values.

 

You can not assign a string/char to a numeric variable.

 

EDIT: Added the missing NOT 😐

Barkamih
Pyrite | Level 9

I'm using proc mixed !!

Astounding
PROC Star

Your "fix" still leaves you with missing values.  What non-missing value could you substitute?  For example, would this make sense?

 

if a = . then a = 0;

gamotte
Rhodochrosite | Level 12

' ' is the missing value for charcater variables while . is the missing value of numerics.

You cannot convert a numeric variable to character on the fly.

 

If you don't want the . to appear in reports you can use

 

option missing=' ';

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!
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
  • 4 replies
  • 694 views
  • 1 like
  • 4 in conversation