Date: Thu, 5 Nov 2009 18:05:27 -0500
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Converting yyyymmdd
I haven't kept up with this thread, but aren't you just asking for something
like:
data have;
format sasdate datetime21.;
sasdate = datetime();
dt = put(dhms(datepart(sasdate),0,0,0),datetime21.);
run;
Art
---------
On Thu, 5 Nov 2009 14:08:12 -0800, Sdlentertd <sdlentertd@GMAIL.COM> wrote:
>On Nov 5, 1:22 pm, barry.a.schw...@BOEING.COM ("Schwarz, Barry A")
>wrote:
>> The PUT function will convert the numeric value to character.
>>
>> The YEAR and MONTH functions will extract the corresponding values from a
date value.
>>
>>
>>
>> -----Original Message-----
>> From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On Behalf Of
Sdlentertd
>> Sent: Thursday, November 05, 2009 11:46 AM
>> To: SA...@LISTSERV.UGA.EDU
>> Subject: Converting yyyymmdd
>>
>> I would like to do two things to yyyymmdd NUMERIC date.
>>
>> 1)convert numeric yyyymmdd into DATETIME19. character.
>>
>> 2) extract Month and year from NUMERIC yyyymmdd so Month will by
>> numeric ( 1 2 3 4...) and the year would be numeric (2001 2003 2007
>> etc.)
>>
>> Thank you.- Hide quoted text -
>>
>> - Show quoted text -
>
>THIS STATEMENT DOES NOT WORK dt = dhms(sasdate,0,0,0);
>This date 20091005 shows up as 1570320000 and not what I need
>05OCT2009:00:00:00
|