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 (January 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: "Liu, Guoyi" <LiuG@NJC.ORG>
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 ; Var1="5365:6.82::5.82:85:::" ; do i = 1 to 8 ; v(i) = input( scan ( tranwrd( var1 , ":" , ": " ), i , ":" ) , 8. ) ; end ; run ; __________________________ Venky Chakravarthy E-mail: swovcc@hotmail.com

-----Original Message----- From: Liu, Guoyi [mailto:LiuG@NJC.ORG] Sent: Monday, January 06, 2003 12:31 PM To: SAS-L@LISTSERV.UGA.EDU Subject:

Hi all, 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.

Guoyi.

LEGAL NOTICE 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.


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