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?

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