Date: Fri, 1 Sep 2006 13:56:00 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: 2 SUBSTR in 1 step
In-Reply-To: <1157071619.051745.62170@74g2000cwt.googlegroups.com>
Content-Type: text/plain; format=flowed
Data _Null_ ;
XXX = "1120036" ;
Zip = SubStr( XXX , Length( XXX ) - 5 ) ;
State = SubStr( XXX , 1 , Length( XXX ) - 5 ) ;
Run ;
Toby Dunn
When everything is coming at you all at once, your in the wrong lane.
A truly happy person is someone who can smile and enjoy the scenery on a
detour.
From: Hala <hala.maktabi@GMAIL.COM>
Reply-To: Hala <hala.maktabi@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: 2 SUBSTR in 1 step
Date: Thu, 31 Aug 2006 17:46:59 -0700
Hi all :)
Given a variable of length 5 where the first 2 digits represent the
state and the second 5 represent a zipcode as such: 1120036, where 11
stands for DC and 20036 is representing the zipcode.
Is there a way to SUBSTR the variable into two (state and zipcode) in
one step?
once again, Thank you very much.
Hala