Dear All,
I have a few values in a variable A of a dataset as follows:
A
Superb xyz
XYZ super
good xyz
good XyZ girl
I would like to find the term xyz whether upcase or lowcase or propcase and replace with some term (example: pqr) in the whole dataset. How can i do that ??
In simple words i would like to replace xyz with pqr.
Any help ?
Try this
data have;
input A $ 1 - 20;
datalines;
Superb xyz
XYZ super
good xyz
good XyZ girl
;
data want;
set have;
A = tranwrd(upcase(A), 'XYZ', 'pqr');
run;
Try this
data have;
input A $ 1 - 20;
datalines;
Superb xyz
XYZ super
good xyz
good XyZ girl
;
data want;
set have;
A = tranwrd(upcase(A), 'XYZ', 'pqr');
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.