BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5
Data x;
input name $;
cards;
company127there
34look67init
name3456745
run;

I want the count of character and numerics in the name variable.
1 REPLY 1
data_null__
Jade | Level 19
[pre]
Data x;
input name :$20.;
cCount=lengthN(compress(name,,'KA'));
nCount=lengthN(compress(name,,'KD'));
cards;
company127there
34look67init
name3456745
JustALpha
22
;;;;
run;
proc print;
run;
[/pre]

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 863 views
  • 0 likes
  • 2 in conversation