Can i know how do i use prxmatch function to identify first two alphabets of these group of customer name?
Needed to identify:-
1. Name starts with A and follow by a space will need to group as “A”. Example: A Academy Ltd 2. Any Name starts from AA to AC will need to group as “AA-AC”. Example: AA Bookstore Pte Ltd, ABC Partnership, Academy Holding 3. Any name starts from AD to AF will need to group as “AD-AF”. Example: Affluent Circle Ltd, Adam James Smith.
data have;
input x $80.;
length group $ 20;
if prxmatch('/^A\s+/i',left(x)) then group='A';
if prxmatch('/^A[A-C]/i',left(x)) then group='AA-AC';
if prxmatch('/^A[D-F]/i',left(x)) then group='AD-AF';
cards;
A Academy Ltd
AA Bookstore Pte Ltd, ABC Partnership, Academy Holding
Affluent Circle Ltd, Adam James Smith.
;
data have;
input x $80.;
length group $ 20;
if prxmatch('/^A\s+/i',left(x)) then group='A';
if prxmatch('/^A[A-C]/i',left(x)) then group='AA-AC';
if prxmatch('/^A[D-F]/i',left(x)) then group='AD-AF';
cards;
A Academy Ltd
AA Bookstore Pte Ltd, ABC Partnership, Academy Holding
Affluent Circle Ltd, Adam James Smith.
;
SAS Innovate 2025: Save the Date
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!