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 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 11 Apr 2007 20:34:47 -0700
Reply-To:   David L Cassell <davidlcassell@MSN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   David L Cassell <davidlcassell@MSN.COM>
Subject:   Re: How can I use scan and substr function
In-Reply-To:   <1176320484.749654.236790@q75g2000hsh.googlegroups.com>
Content-Type:   text/plain; format=flowed

ethan06460@YAHOO.COM wrote: > >Hi all, > >If I have a variable called "REASON". Because the value for this >variable are too long, so I need to divided into two variables. >Reason1 and Reason2. I use reason1 = substr(reason, 1, 100) and >reason2 = substr(reaso, 101, 200). >I found out there is one problem, there are some values being >truncated. I think I need to use SCAN. But there are several comma and >space in between the values, How can I do this? > >Thanks

Is your only criterion that the split be between words and not in the middle of a word?

Or do you have more meaningful criteria that should be taken into account?

How long are the strings anyway? Is cutting this into 100 plus 'something else' going to give you really uneven strings?

And what are you going to do with these variables afterward that makes you want to split them?

HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ Mortgage rates near historic lows. Refinance $200,000 loan for as low as $771/month* https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h27f8&disc=y&vers=689&s=4056&p=5117


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