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 (March 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 22 Mar 2006 21:38:55 -0800
Reply-To:   jato <jato88@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   jato <jato88@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: Read a variable from Right to Left
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1142981639.138970.269620@t31g2000cwb.googlegroups.com>
Content-Type:   text/plain; charset="iso-8859-1"

If the variable seperated by comma, then you can try the below: data add; input address $30.; apartment=scan(address,-1,','); cards; 114,Mills Rd,Apt 202 345,Morris Drive,Apt 345 678,Chestnut Avenue,Apt# 987 ; run;

proc print; run;

Richie wrote: > Hi All, > > I want help to substring a variable from right to left, for eg: I have > a SAS data set which has a variable Address like. > > Address > > 114, Mills Rd, Apt 202 > 345 Morris Drive, Apt 345 > Chestnut Avenue Apt # 987 > > Is there a way I can create a variable say Type like > > Type > > Apt202 > Apt345 > pt#987 > > Thanks, > Richie


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