BookmarkSubscribeRSS Feed
gandikk
Obsidian | Level 7

There are 2 fields called Company Name and Tradestyle. My requirement is if company name is ABC Company "Software" and the tradestyle is Software; I have to change the company name to ABC Company. That means I have to remove the string in double quotes from the Company Name if it is matched to Tradestyle. Can anyone help on this?

SAS@EMMAUS
1 REPLY 1
Kurt_Bremser
Super User

if company_name = 'ABC Company "Software"' and tradestyle = 'Software' then company_name = 'ABC Company';

More generic:

if substr(company_name,length(company_name)-length(tradestyle)-1) = '"'!!trim(tradestyle)!!'"' then

company_name = substr(company_name,1,length(company_name)-length(tradestyle)-3);

Please avoid to post the same question to multiple communities in the future.

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1329 views
  • 0 likes
  • 2 in conversation