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 (January 2000, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 3 Jan 2000 15:52:38 +0100
Reply-To:     detecsm_hellriegelg@WESTLB.DE
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Gehard Hellriegel <detecsm_hellriegelg@WESTLB.DE>
Subject:      Antwort: Date Format Question
Content-type: multipart/mixed;
              Boundary="0__=7btcKTqPFlY9M8lax3l3zpaHqPUOonEaHBfkwMgokMcydwFDKMHVgGQM"

you should do the following: convert the date with the PUT function to a string, split it off by the SUBSTR function in year, month and day, then convert the parts back to numbers by INPUT. Then you can use the MDY function to build a real SAS date-value and format it with yymmdd6.

data test; set dates; d=put(x1,6.);

dx1=mdy(input(substr(d,3,2),$2.),input(substr(d,5,2),$2.),1900+input(substr(d,1,2),$2.)); format dx1 yymmdd6.; run;

DaeYun Kim <kustat8914@NETSGO.COM> on 03.01.2000 04:25:01

Bitte antworten an DaeYun Kim <kustat8914@NETSGO.COM>

An: SAS-L@LISTSERV.UGA.EDU Kopie: (Blindkopie: DeTeCSM HellriegelG/D/ExternalStaff/WLB) Thema: Date Format Question


Dear All,

My problem is like this...

I have one variable called x1, and this format is best12. For example,

x1 950101 950102 950103 ...

In the above, 950101 means January 1st, 1995. What I want is changing the format of x1 such as yymmdd6. I've tried "format x1 yymmdd6.", but it failed. Is there any suggestion?

Any comment will be appreciated. Thanks...

Happy New Millennium!

-- Master Degree Korea University Graduate Dept. of Statistics

Cellular Phone : 011-341-7554

HomePage : http://myhome.netsgo.com/kustat8914 e-mail1 : kustat8914@netsgo.com e-mail2 : dykim@kustat.korea.ac.kr

Mit freundlichen Grüßen

Gerhard Hellriegel, DeTeCSM

WestLB Abteilung: 001-80622 Aderstr. 22 D - 40217 Duesseldorf Tel.: +49211 826 6173 Fax: +49211 826 5393


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