Date: Wed, 3 Oct 2007 02:54:11 +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: SAS date format problem
Content-Type: text/plain; charset="iso-8859-1"
Data _Null_ ;
OldDate = 322 ;
NewDate = Input( Put( OldDate , Z6. ) , YYMMDD6. ) ;
Put NewDate= YYMMDD8.
NewDate= MMDDYY10. ;
Compromise is like telling a lie, it gets easier and easier. Each compromise you make, that becomes your standard.
Perfection doesnt exist, once you reach it, its not perfect anymore. It means something else.
> Date: Tue, 2 Oct 2007 19:48:29 -0700
> From: a320@HOTMAIL.COM
> Subject: SAS date format problem
> To: SAS-L@LISTSERV.UGA.EDU
> I have a SAS dataset that has dates in the following format: YYMMDD.
> For example, I would have a date that looks like this: 322. It means
> 00-03-22 (Mar 22, 2000)- all the leading 0s are truncated. However, if
> I format it using the YYMMDD8. format, I get something that looks like
> 60-11-18, or 322 days since Jan 1, 1960.
> How do I make SAS recognize a date like 322 as Mar,22 2000 or 20808 as
> Aug 8th, 2002?
> Thanks in advance.
Help yourself to FREE treats served up daily at the Messenger Café. Stop by today.