|Date: ||Mon, 6 Jan 2003 14:06:40 -0500|
|Reply-To: ||"Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||"Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>|
|Subject: ||Re: Splitting up a character Variable to Numeric Values|
|Content-Type: ||text/plain; charset="iso-8859-1"|
This question came without a subject header:
Here is one way of doing this. Insert a space after every colon and then
input the scanned value of VAR1 with the colon separator.
data q ( drop = i ) ;
array v (8) var2 - var9 ;
do i = 1 to 8 ;
v(i) = input( scan ( tranwrd( var1 , ":" , ": " ), i , ":" ) , 8. ) ;
From: Liu, Guoyi [mailto:LiuG@NJC.ORG]
Sent: Monday, January 06, 2003 12:31 PM
Happy new year! This is Guoyi Liu from Colorado, I posted a question to
listserv several month ago. I have a question about SAS data management
aagain, I am not sure if someone could help me again. My queston is below.
Var1="5365:6.82::5.82:85:::" Format is Char.
between two ':' there is a missing value. How can I seperate them to
var2 var3 var4 var5 var6 var7 var8 var9
5365 6.82 . 5.82 85 . . .
Thank you very much.
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.