BookmarkSubscribeRSS Feed
Elliott
Obsidian | Level 7

Hello, 

I need some help with transactional data and I am not sure where to begin.

 

I need to search transaction data in a comments field for a numeric string (Account Number).

 

I have a data set with multiple rows with a unique id and time stamp to group all records together a chat transcript.

 

I need to pull the account number from the comments field without knowing what it is.  I only know it will be 16 digits.  The client may have entered it all in one string or it could be like xxxx xxxx xxxx xxxx.  Hopefully there is no other way.  

 

Can anyone assist me with this?

 

Thanks in Advance.

 

Elliott

 

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

One way:

where prxmatch('/\d{16}/',compress(COMMENT,' '));

This looks for 16 digits in a string where spaces are removed. Suitable?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 348 views
  • 0 likes
  • 2 in conversation