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 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 8 Feb 2005 15:42:32 -0800
Reply-To:     "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject:      Re: obtain the date part
Comments: To: Xiaobin <shensakura@GMAIL.COM>

Try this (oops) -

data dates; input date_time $20.; length date_text $10; date_text=scan(date_time,1,' '); date_num=input(scan(date_time,1,' '),mmddyy8.); format datenum mmddyy10.; cards; 7/24/96 18:36:45 10/12/96 20:26:54 ; run;

hth

Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Xiaobin Sent: Tuesday, February 08, 2005 3:22 PM To: SAS-L@LISTSERV.UGA.EDU Subject: obtain the date part

Hi all,

I have a date variable together with time, such as "7/24/96 18:36:45" or "10/12/96 20:26:54", how can I obtain the only date part such as "7/24/96" or "10/12/96"?

Please note the length of the date part is different.

Thank you for your help.

Best, Xiaobin


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