LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 28 Feb 2008 14:11:57 -0500
Reply-To:     Jack Clark <JClark@CHPDM.UMBC.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Clark <JClark@CHPDM.UMBC.EDU>
Subject:      Re: easy but not getting expected out put(Very urgent)
Comments: To: reddy <mail2karna@GMAIL.COM>
In-Reply-To:  A<3bbb8ed0-e035-4ac0-b0a0-fb3ae53124f8@i12g2000prf.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"

Reddy,

Your initial variable (X) is a SAS date - the number of days since Jan 1, 1960. To SAS, it is just a number (16,285).

When you switch to a datetime format, as with the variable CREATION, SAS now interprets the number (16,285) as the number of seconds elapsed since midnight on Jan 1, 1960.

One quick and dirty method would be to multiply your DAYS count by 86,400 (the number of seconds in a day), then use the datetime format.

Replace creation = x; With creation = x * 86400;

Jack Clark Research Analyst Center for Health Program Development and Management University of Maryland, Baltimore County

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of reddy Sent: Thursday, February 28, 2008 1:57 PM To: SAS-L@LISTSERV.UGA.EDU Subject: easy but not getting expected out put(Very urgent)

Hi,

i have input value 02aug2004 when i use datetime. format it is showing 01jan1960:00:00:01 but i want 02jaug2004:00:00:00 see example also mentioned bellow

data tess; input x date9.; cards; 02aug2004 ; run;

data tes; set tess; creation=x; format creation datetime19.; proc print; run;

THnaks in advance Mail2karna@gmail.com


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