Date: Thu, 1 May 2008 10:47:13 -0700
Reply-To: irinfigvam@yahoo.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Irin later <irinfigvam@YAHOO.COM>
Subject: Re: How to construct the string ID ?
In-Reply-To: <OFD1479BA4.395837B0-ON85257434.00495BC8-85257434.00497608@dom.com>
Content-Type: text/html; charset=utf-8
<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'><P>A this time I have newid (name+year+month+day+gender) r example ADAM19480204M</P>
<P>I need to rebuild it in order it looks like:</P>
<P> </P>
<P> ADAM194802M</P>
<P>(Name can vary up to 5 letters)</P>
<P> </P>
<P>In other words I need to take out DAY part.</P>
<P> </P>
<P>Could you give me a hand ,please , with this code?</P>
<P> </P>
<P>Thank you in advance,</P>
<P> </P>
<P>Irin</P>
<P> </P>
<P><BR><BR>--- On <B>Wed, 4/23/08, Nathaniel.Wooding@dom.com <I><Nathaniel.Wooding@dom.com></I></B> wrote:<BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Nathaniel.Wooding@dom.com <Nathaniel.Wooding@dom.com><BR>Subject: Re: How to construct the string ID ?<BR>To: irinfigvam@yahoo.com<BR>Cc: SAS-L@LISTSERV.UGA.EDU<BR>Date: Wednesday, April 23, 2008, 9:22 AM<BR><BR><PRE>If modified, Pauls code works nicely with fewer than five letters and an
internal space
Data newid;
id ='L LO195703F';
NewID = cats( compress( substr (ID, 1, 5) , '0123456789' ), substr
(ID,
anydigit (ID) )) ;
put newid;
run;
Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Irin later
<irinfigvam@YAHOO
.COM> To
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
Discussion" cc
<SAS-L@LISTSERV.U
GA.EDU> Subject
Re: How to construct the string ID
?
04/23/2008 09:14
AM
Please respond to
irinfigvam@yahoo.
com
Jack, I do not have spaces, but scenarion with less than 5 letters did not
even come to my mind .It actually can….
Is it possible to do it in such a case?
--- On Wed, 4/23/08, Jack Clark <JClark@CHPDM.UMBC.EDU> wrote:
From: Jack Clark <JClark@CHPDM.UMBC.EDU>
Subject: Re: How to construct the string ID ?
To: SAS-L@LISTSERV.UGA.EDU
Date: Wednesday, April 23, 2008, 8:49 AM
Irin,
This assumes no missing characters in the ID structure you described and
no names less than 5 characters.
data _null_;
length id2 $12;
id = 'LOLOBRIDGIDA195703F';
id2 = substr(id,1,5)||reverse((substr(reverse(id),1,7)));
put _all_;
run;
Jack Clark
Research Analyst
Center for Health Program Development and Management
University of Maryland, Baltimore County
________________________________
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Irin later
Sent: Wednesday, April 23, 2008 8:36 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: How to construct the string ID ?
I have ID that includes a name, year of birth, month of birch an gender
LOLOBRIDGIDA195703F
I need to construct id of just 5 letters of that first name and the
rest of the ID above:
LOLOB195703F
How can I implement it with a code (I mean all names has different
length)?
Thank you in advance,
Irin
________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try
it now.
<http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62
sR8HDtDypao8Wcj9tAcJ%20>
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
now.
-----------------------------------------
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.</PRE></BLOCKQUOTE></td></tr></table><br>
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>
|