BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASPhile
Quartz | Level 8

where prxmatch('/^3[47][1236789].*/',put(cm13,13.))

What does the above prxmatch do?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Try strip(put(...  adjusting parantheses to match

The format is putting out a string of 13 characters but the leading characters are blanks. So the substr is returning '   '

View solution in original post

5 REPLIES 5
Ksharp
Super User

It means the first digit(at the beginning of the string) should be 3 ,the second digit shoud be 4 or 7 . the third digit should be 1 or 2 ...........

SASPhile
Quartz | Level 8

The hat(^) means not to include right?

Haikuo
Onyx | Level 15

I am afraid not. ^ here is to match beginning of line; [^abc] is to match a character not in the brackets.

Haikuo

SASPhile
Quartz | Level 8

When I use prx match and substr I'm getting different results.

If I substituted with substr function where substr(put(cm13,13.),1,3)='347'; I'm getting zero records.

Where as with PRX I'm getting some records.

ballardw
Super User

Try strip(put(...  adjusting parantheses to match

The format is putting out a string of 13 characters but the leading characters are blanks. So the substr is returning '   '

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 984 views
  • 7 likes
  • 4 in conversation