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 (May 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 1 May 2008 14:12:36 -0500
Reply-To:     Citam <citam.sasl@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Citam <citam.sasl@GMAIL.COM>
Subject:      Re: How to take out the part of the string ID? Need help.
In-Reply-To:  <244128.99305.qm@web51612.mail.re2.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1

On 5/1/08, Irin later <irinfigvam@yahoo.com> wrote:

> I have newid for example > ADAM19480204M (name+year+month+day+gender) > I need to rebuild it in order it looks like: > ADAM194802M (name+year+month+gender) > > (Name can vary up to 5 letters) > In other words I need to take out DAY part.

You have at least one function at your disposal: SUBSTR().

In particular, if only name varies, you might be able to use:

SUBSTR (left of =) Function

Online example:

a='KIDNAP'; substr(a,1,3)='CAT'; put a;

CATNAP

HINT: consider the use of the null string "".


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