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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 481 views
  • 0 likes
  • 3 in conversation