BookmarkSubscribeRSS Feed
Ksharp
Super User

Use PROC SQL instead .

 

data have ;                                                         
  input n1 c1:$1. n2 c2:$2. n3 c3:$3. ;                             
  cards ;                                                           
0  .  00  AA  000  .                                                
.  B  11  .   111  BBB                                              
2  C  .   CC  .    CCC                                              
3  .  .   DD  333  DDD                                              
.  E  44  EE  444  .                                                
5  F  .   FF  555  FFF                                              
6  .  66  GG  666  GGG                                              
7  H  .   HH  .    HHH                                              
.  I  .   .   888  .                                                
9  .  99  JJ  999  .                                                
;                                                                   
run ; 

proc sql;
create table want as
select n(n1) as n_nomiss_n1,nmiss(n1) as n_miss_n1,
       n(c1) as n_nomiss_c1,nmiss(c1) as n_miss_c1
 from have;
quit;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 15 replies
  • 4082 views
  • 3 likes
  • 7 in conversation