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=' ';

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 887 views
  • 1 like
  • 4 in conversation