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;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 746 views
  • 0 likes
  • 3 in conversation