|
Ryan,
I'm sure our PRX afficianados could suggest a simpler solution, but the
following data step logic could also be applied:
data want;
length word $30;
input word @@;
if substr(word,1,3) eq 'x10' and
substr(reverse(trim(word)),1,2) eq 'l/'
then output;
cards;
mm3 or /µl or x10e6/l
x10e3/µl or x10e9/l or G/l or /nl
;
HTH,
Art
-------
On Fri, 17 Apr 2009 17:47:38 -0400, Ryan Krause <ryan.krause@GMAIL.COM>
wrote:
>I have a dataset with a unit variable that is a text string with multiple
>units in it. Example unit strings:
>"mm3 or /µl or x10e6/l"
>OR
>"x10e3/µl or x10e9/l or G/l or /nl"
>
>I need to extract out the x10??/l (?? are wildcards) unit since these I
can
>use for further analysis. I'm running SAS 8.2 - how could I extract out
>these units? Originally I thought I could find the index that 'x10'
starts
>at but that doesn't work since it would grab 'x10e3/µl when I would want
to
>grab x10e9/l. Thanks.
|