BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BrahmanandaRao
Lapis Lazuli | Level 10

Data dsn;

X='america';

run;

 

I want Output like

AmeRiCa 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

If so, then do something like this

 

data _null_;
   string="america";
   newstring=translate(string, "ARC", "arc");

   put string= // newstring=;
run;

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

What is the logic here? Do you want to consequently Upcase the letters A, R and C?

PeterClemmensen
Tourmaline | Level 20

If so, then do something like this

 

data _null_;
   string="america";
   newstring=translate(string, "ARC", "arc");

   put string= // newstring=;
run;
Kurt_Bremser
Super User

If there is a logical rule for this conversion, you need to tell us that, so we can translate it into code.

If there is no logical rule, then there's no base for any code.

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 save with the early bird rate—just $795!

Register now

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
  • 3 replies
  • 809 views
  • 2 likes
  • 3 in conversation