I am trying to get name starting with letter R and ending with A

Reply
New Contributor
Posts: 2

I am trying to get name starting with letter R and ending with A

Trying to use where statement Like 'R%' but how to get ending with letter A?

Respected Advisor
Posts: 4,608

Re: I am trying to get name starting with letter R and ending with A

where prxMatch("/^R.*A$/i", myVariable) > 0;

 

 

PG
Contributor
Posts: 62

Re: I am trying to get name starting with letter R and ending with A

Use variable_name LIKE 'R%A';

 

Below I am creating a dataset which data consist start with R and end with A.

 

Code to create sample data set "

 

data demo;
input name $;
datalines;
RITA
SITA
NITA
RASHNA
KAVITA
;
RUN;

 

code to search letter start with R and end with A.

 

PROC PRINT DATA =DEMO;
WHERE NAME LIKE 'R%A';
RUN;

 

result.PNG

sas1212.PNG

New Contributor
Posts: 2

Re: I am trying to get name starting with letter R and ending with A

Thankyou very much for your reply

Ask a Question
Discussion stats
  • 3 replies
  • 276 views
  • 3 likes
  • 3 in conversation