Date: Mon, 19 Jul 2010 17:17:47 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: date cleaning/conversion
In-Reply-To: <635592.64937.qm@web25602.mail.ukl.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
If in fact your march months have an 's' in them:
Date = InPut( PrxChange( 's/^(\d\d).(\w\w\w).+?(\d*)$/$1$2$3/io' , 1 , Strip( Temp ) ) , AnyDtDte. ) ;
If it was a typo and you know you only have the three character month name then you can do:
Date = Input( Compress( D1 , '/-. ' ) , AnyDtDte. ) ;
Toby Dunn
"Don't bail. The best gold is at the bottom of barrels of crap."
Randy Pausch
"Be prepared. Luck is where preparation meets opportunity."
Randy Pausch
> Date: Mon, 19 Jul 2010 10:05:14 -0700
> From: franz_cl2003@YAHOO.FR
> Subject: date cleaning/conversion
> To: SAS-L@LISTSERV.UGA.EDU
>
> Dear All,
>
> How do I convert d1 into date9. format?
>
> data dummy;
> input d1 $15.;
> cards;
> 02/jan/75
> 04.feb.2007
> 14-mars.71
> 15/mars.2005
> 12-dec-2008
> 18.apr.70
> ;
>
>
> Thanks & Kind regards,
> Franz
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 |