LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 2 Jul 2001 15:04:03 +0200
Reply-To:     "Tribius, Heide" <Heide.Tribius@KFW.DE>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Tribius, Heide" <Heide.Tribius@KFW.DE>
Subject:      Re: Time input.
Content-Type: text/plain; charset="iso-8859-1"

hello Xiaoyuan,

if you want to have just one (datetime) variable you should use the dhms-function:

data _null_; infile 'd:\test.txt'; * 2000-03-30 07:20:22; input date yymmdd10. time time8.;

dttm = dhms(date, hour(time), minute(time), second(time));

format dttm datetime20.; put dttm=; run;

Heide

-----Original Message----- From: Xiaoyuan Zhu [mailto:ZhuX@flcourts.org] Sent: Monday, July 02, 2001 2:34 PM To: Heide.Tribius@kfw.de Subject: RE: Time input.

Good morning, Heide. Actually, it is only one variable. I have taken a suggestion from SAS-L@LISTSERV as follows to solve my problem.

data test; infile 'c:\temp\abc.txt'; input dttm_str $19.; dttm = input(compress(scan(dttm_str,1,' '),'-'),yymmdd8.) * (60*60*24) + input(scan(dttm_str,2,' '),time8.); format dttm datetime20.; run;

Thank you for your code.

Xiaoyuan


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