LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) 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 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 ?
Comments: To: Nathaniel.Wooding@dom.com
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&nbsp;&nbsp; (name+year+month+day+gender) r example ADAM19480204M</P> <P>I need to rebuild it in order it looks like:</P> <P>&nbsp;</P> <P>&nbsp;&nbsp;&nbsp; ADAM194802M</P> <P>(Name can vary up to 5 letters)</P> <P>&nbsp;</P> <P>In other words I&nbsp; need to take&nbsp;out &nbsp;DAY part.</P> <P>&nbsp;</P> <P>Could you give me a hand ,please , with this code?</P> <P>&nbsp;</P> <P>Thank you in advance,</P> <P>&nbsp;</P> <P>Irin</P> <P>&nbsp;</P> <P><BR><BR>--- On <B>Wed, 4/23/08, Nathaniel.Wooding@dom.com <I>&lt;Nathaniel.Wooding@dom.com&gt;</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 &lt;Nathaniel.Wooding@dom.com&gt;<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 &lt;irinfigvam@YAHOO .COM&gt; To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU

Discussion" cc

&lt;SAS-L@LISTSERV.U GA.EDU&gt; 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 &lt;JClark@CHPDM.UMBC.EDU&gt; wrote: From: Jack Clark &lt;JClark@CHPDM.UMBC.EDU&gt; 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. &lt;http://us.rd.yahoo.com/evt=51733/*http:/mobile.yahoo.com/;_ylt=Ahu06i62

sR8HDtDypao8Wcj9tAcJ%20&gt;

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>


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