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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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