data dsn;
input email $20.;
datalines;
Abc@123Ind
cd!345Aus
thr%34344Us
;
run;
output Like below
Abc@123IND
cd!345AUS
thr%34344US
data want;
set dsn;
first=cats(scan(email,1,'@!%'));
delim=substr(email,length(first)+1,1);
second=upcase(scan(email,2,'@!%'));
email=cats(first,delim,second);
drop first delim second;
run;
May I ask ... why? What is the benefit of converting parts of email addresses to capital letters? There is no requirement that e-mails addresses be capitalized.
data want;
set dsn;
first=cats(scan(email,1,'@!%'));
delim=substr(email,length(first)+1,1);
second=upcase(scan(email,2,'@!%'));
email=cats(first,delim,second);
drop first delim second;
run;
May I ask ... why? What is the benefit of converting parts of email addresses to capital letters? There is no requirement that e-mails addresses be capitalized.
Hi @PaigeMiller I do agree with you
Interview panel asked these type of questions
Ok, thanks. Pointless question, asking someone how to do work that doesn't need to be done.
data dsn;
input email $20.;
datalines;
Abc@123Ind
cd!345Aus
thr%34344Us
;
run;
data want;
set dsn;
want=prxchange('s/([a-z]+$)/\U\1/',1,strip(email));
run;
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!
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.