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

Hi all, 

 

I just came across this page documenting Perl regular expressions for Dataflux. Do the data step Perl RegEx functions have the same level of capability? I tried using \h for horizontal white space once, but it didn't work.

 

https://support.sas.com/documentation/onlinedoc/dfdmstudio/2.6/dmpdmsug/Content/DMCust_RegexLibUse.h... 

 

Thanks

Barry

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Oh sorry. You use \h.

Yes, unsupported in SAS.

You can use: \x09 \t \s [[:blank:]]

The latter is equivalent to \h

View solution in original post

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

It works for me.

data T; D=prxmatch('/\t/','2009'x); putlog D=; run;

D=2

 

ChrisNZ
Tourmaline | Level 20

Oh sorry. You use \h.

Yes, unsupported in SAS.

You can use: \x09 \t \s [[:blank:]]

The latter is equivalent to \h

barryG
Calcite | Level 5
Thanks, Oh well.

Looks like you can use \v for vertical white space. It would have been nice
to have the whole set available in Dataflux available in the data step, too.
ChrisNZ
Tourmaline | Level 20

Yes more consistency would be nice. And easy to do.

And not only here.

 

barryG
Calcite | Level 5
Isn't that truncation a feature of the SAS functions in the data step, too?
I'm not sure what the ANSI standard is, but I'm pretty sure SAS options
like length=, format=, label= are SAS extensions, not part of the standard.

More valuable to me would be if Proc SQL would honor length specifications
on numeric variables in Create Table;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 540 views
  • 0 likes
  • 2 in conversation