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 (December 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Dec 2009 06:12:16 -0800
Reply-To:     Chris Jones <chrisj75@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Chris Jones <chrisj75@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: Scan function
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On 2 Dec, 13:33, christine.bene...@HOTMAIL.COM (Chris Benefer) wrote: > I am trying to use SCAN to split a text field with data like > > 11 "In particular senior consultants who do not like the "new" medical > course" > > into 2 variables > > var1 11 > var2 In particular senior consultants who do not like the "new" medical > course > > I have tried using scan e.g. var2 = scan(var,2,'"'); > I have tried using modifiers to ignore the embedded " to no avail. > > Can anyone help

Use scan to get the first part, then substr & length to get the rest....

var1 = scan(var,1,' '); var2 = substr(var,length(var1)+1,length(var)-(length(var1))) ;


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