Date: Thu, 1 May 2008 14:28:03 -0400
Reply-To: Paul St Louis <pstloui@DOT.STATE.TX.US>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul St Louis <pstloui@DOT.STATE.TX.US>
Subject: Re: How to construct the string ID ?
Hi Irin,
I am using Windows XP and SAS 9.1...I think this might get what you want.
Data Have;
Input @1 Old $14.;
Datalines;
Adam19480204m
Stlo19620408m
;
Data Need (Drop = Temp1 Temp2 New);
Length New $14.;
Set Have;
Temp1 = Left(Reverse(Old));
Sex = Substr(Temp1,1,1);
Temp2 = Substr(Temp1,4,10);
New = Reverse(Temp2);
Fin = Cats(New,Sex);
Run;
Proc Print;
Var Old Fin Sex;
Run;
On Thu, 1 May 2008 10:47:13 -0700, Irin later <irinfigvam@YAHOO.COM> wrote:
><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>
|