LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 17 Apr 2009 18:10:10 -0400
Reply-To:   Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: Help substring out specific units
Comments:   To: Ryan Krause <ryan.krause@GMAIL.COM>
Content-Type:   text/plain; charset=ISO-8859-1

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.


Back to: Top of message | Previous page | Main SAS-L page