I'm sure our PRX afficianados could suggest a simpler solution, but the
following data step logic could also be applied:
length word $30;
input word @@;
if substr(word,1,3) eq 'x10' and
substr(reverse(trim(word)),1,2) eq 'l/'
mm3 or /µl or x10e6/l
x10e3/µl or x10e9/l or G/l or /nl
On Fri, 17 Apr 2009 17:47:38 -0400, Ryan Krause <ryan.krause@GMAIL.COM>
>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"
>"x10e3/µl or x10e9/l or G/l or /nl"
>I need to extract out the x10??/l (?? are wildcards) unit since these I
>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'
>at but that doesn't work since it would grab 'x10e3/µl when I would want
>grab x10e9/l. Thanks.