Skip to content
Advertisement

How to use prxmatch or alternative for below string in sas

I have multiple rows of strings

I want remove and create new column with 25% and 20% and so on… From above string.

How can I do that in SAS? The new column should flow 25% i.e percentage.

So on….

Advertisement

Answer

A single percentage value (or none) can be retrieved from a string using a pattern with a grouping expression (<something>), prxmatch, and prxposn to retrieve the characters matching the grouped expression.

Example:

The percentage is presumed to be a whole number followed immediately by a percent sign.

Store the percentage as a fraction (presumed to be in 0 to 1 range) whose value is formatted for display as a percentage.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement