Date: Fri, 29 Feb 2008 00:30:17 -0800
Reply-To: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Nordlund, Dan (DSHS/RDA)" <NordlDJ@DSHS.WA.GOV>
Subject: Re: easy but not getting expected out put(Very urgent)
In-Reply-To: <1ba5c46a-9283-4b7a-a685-2c6edd7961f3@41g2000hsc.googlegroups.com>
Content-Type: text/plain; charset=iso-8859-1
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
> Behalf Of reddy
> Sent: Thursday, February 28, 2008 11:25 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: easy but not getting expected out put(Very urgent)
>
> On Feb 28, 8:50 pm, RolandRB <rolandbe...@hotmail.com> wrote:
> > On Feb 28, 7:57 pm, reddy <mail2ka...@gmail.com> wrote:
> >
> >
> >
> >
> >
> > > 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
> > > Mail2ka...@gmail.com
> >
> > Try this instead.
> >
> > data tess;
> > informat x date9.;
> > input x ;
> > format x date9.;
> > cards;
> > 02aug2004
> > ;
> > run;
> >
> > data tes;
> > set tess;
> > creation=dhms(x,0,0,0);
> > format creation datetime19.;
> >
> > proc print;
> > run
>
>
> This code is working if i want 02aug2004:23:12:33.000 like exact
> value what can ido
>
Try something like this
create_d = '02aug2004'd;
create_t = '23:12:33't;
creation = dhms(create_d,0,0,create_t);
format creation datetime22.3;
Hope this is helpful,
Dan
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204
|