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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 15 replies
  • 4430 views
  • 3 likes
  • 7 in conversation