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 (December 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 9 Dec 2004 07:35:33 -0800
Reply-To:     Dennis Diskin <diskin@SNET.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Dennis Diskin <diskin@SNET.NET>
Subject:      Re: Q on extracting data from a variable
Comments: To: RAHUL CHAHAL <rahulchahal@YAHOO.COM>
In-Reply-To:  <20041209150639.74684.qmail@web14227.mail.yahoo.com>
Content-Type: text/plain; charset=us-ascii

Rahul,

One way is to use the SCAN function:

acct1=scan(acct,1,'-'); acct2=scan(acct,2,'-'); acct3=scan(acct,3,'-');

Of course, if you want the numeric values, you'll need to in INPUT function also.

HTH, Dennis Diskin

RAHUL CHAHAL <rahulchahal@YAHOO.COM> wrote: Hi, Would like to find out how to extract the following values of a variable:

Acct 1 - 1111 - 123456 1 - 121212 - 9876543 1 - 21212 - 909045600 99 - 32435465 - 121

Into 3 variables:

Acct1 Acct2 Acct3 1 1111 123456 1 121212 9876543 1 21212 909045600 99 32435465 121

Thanks for your help.

Rahul

--------------------------------- Do you Yahoo!? Meet the all-new My Yahoo! Try it today!


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