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

Hello everyone,

 

Anyone can explain why x3=0? I thought x3 returns the number of missing values of {1, 0, ., 2, 5, ., 1, 0} (combine numbers for x1 and numbers for x2), so x3 should be 2, but it's 0. I get confused this.

 data one;                                                                                                                               
 x1=nmiss(1, 0, ., 2, 5, .);                                                                                                            
 x2=nmiss(1, 0);                                                                                                                        
 x3=nmiss(of x1-x2);                                                                                                                    
 put x1= x2= x3=;                                                                                                                       
run; 
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
x1 = 2
x2 = 0
x3 = nmiss(2, 0) => none are missing therefore this is 0 as well.

Perhaps you mean to do
x3 = sum(x1, x2);

View solution in original post

2 REPLIES 2
Reeza
Super User
x1 = 2
x2 = 0
x3 = nmiss(2, 0) => none are missing therefore this is 0 as well.

Perhaps you mean to do
x3 = sum(x1, x2);
lc7033907
Obsidian | Level 7

Yes, you are right. I made a stupid error. I thought x1 and x2 are those numbers in the above, but actually they are returned values. Thanks.

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 578 views
  • 0 likes
  • 2 in conversation