Date: Thu, 15 May 2008 06:44:17 -0500
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: regarding date format
In-Reply-To: <200805151126.m4FAkjIl030583@malibu.cc.uga.edu>
Content-Type: text/plain; charset=UTF-8
I think there may be a format that displays the data as you desire but
I don't know the name. Otherwise you can make a format to display a
date in any number of ways.
551 picture ddmonyy(default=11)
552 other='%0d-%b-%Y' (datatype=date);
NOTE: Format DDMONYY has been output.
553 run;
554
555 data _null_;
556 input date :date11.;
557 format date ddmonyy.;
558 put date=;
559 cards;
date=15-MAY-2008
On 5/15/08, Gerhard Hellriegel <gerhard.hellriegel@t-online.de> wrote:
> what do you mean with "numeric"? Where do you find numeric months with 3
> digits? 01-123-2007 ??
>
> For reading a date like you mentioned, use
>
> data x;
> x="01-mar-2008";
> date=input(x,date11.);
> format date ddmmyy10.;
> put date=;
> run;
>
> Note: you need a INFORMAT not a format to read a date.
> To put it out like:
>
> dd/mm/yyyy
>
> (if you like '-' instead of '/', TRANSLATE it:
>
> datec = translate(put(date,ddmmyy10.),"-","/");
>
> or look for a format which gives you a data, you like.
>
> E.g. you can use the format ddmmyyD10. to leave the date as numeric value,
> but show it with dashes. The better way to work with it!
>
>
> Gerhard
>
>
>
>
>
> On Thu, 15 May 2008 02:42:21 -0700, Yuewei Liu <yueweiliu@VIP.QQ.COM>
> wrote:
>
> >On 5Ԃ15ȕ, ςΧ2ʱ09?֬ shashi <shashi2...@gmail.com> wrote:
> >> Hi,
> >> Is there any date informat to read the date which is in the form of dd-
> >> mmm-yyyy(i.e. 15-May-2008) and the date format to display the date in
> >> the form of dd-mmm-yyyy (it should be numeric)? Could anybody please
> >> suggest on this?
> >>
> >> Thanks,
> >> Shashi
> >
> >Hi, Shashi
> >
> >You could try compress function .
> >
> >Yuewei
>
|