BookmarkSubscribeRSS Feed
T_me
Calcite | Level 5

Please help, I want to scan the words that are within the brackets.

Customer

Customer: Cho0012 (Industrial filling station T/A Caltex mogoboshane)

Customer: cho0013 (Choppies complex supermarket)

Customer: SPA0107 (K.A.W ENTERPRISES (PTY) LTD T/A SPAR MOGODITSHANE)

 

Thanks

T_me

2 REPLIES 2
PaigeMiller
Diamond | Level 26

What is the desired output?

--
Paige Miller
asuman
Obsidian | Level 7
For better understanding ,kindly provide the desired o/p also.But this might help you.

data test;
input customer & $200.;
cards;
Cho0012 (Industrial filling station T/A Caltex mogoboshane)
cho0013 (Choppies complex supermarket)
SPA0107 (K.A.W ENTERPRISES (PTY) LTD T/A SPAR MOGODITSHANE)
;
run;
data test1(drop=a b);
length a $200. c $200.;
set test;
a=compress(scan(customer,2, '('),')');
b=compress(scan(customer,3,'('),')');
c=catx('',a,b);
run;

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 Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 788 views
  • 0 likes
  • 3 in conversation