|
Change to "99:99:99" and read tm in as numeric!
proc format ;
picture cnvtm low - high = "99:99:99" ;
run ;
data test1;
input skip $ tm ;
cards ;
20000101 93526
20000103 100511
20000106 175632
20020531 931
20020531 1931
;
proc print;
format tm cnvtm.;
run;
----------------
Obs skip tm
1 20000101 09:35:26
2 20000103 10:05:11
3 20000106 17:56:32
4 20020531 00:09:31
5 20020531 00:19:31
Kind regards,
Ya Huang
-----Original Message-----
From: PBourdages@IAG.QC.CA [mailto:PBourdages@IAG.QC.CA]
Sent: Friday, May 31, 2002 10:05 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Time problem....
I found out a problem with the following code... When I have records with
time period ranging from midnight and 1 seconds till 1:00 AM, the time get
mixed up somehoy...
proc format ;
picture cnvtm low - high = "00:00:00" ;
run ;
data test1;
input skip $ tm $ ;
format tt time8.;
time = input(put(input(tm,8.),cnvtm.),time8.);
put time time8.;
tt = time;
Heure = hour(tt);
minute = minute(tt);
seconde = second(tt);
cards ;
20000101 93526
20000103 100511
20000106 175632
20020531 931
20020531 1931
;
dm "vt test1" continue;
When runned, the first three record are OK but the following two are messed
up... Why ?
They should return 00:09:31 and 00:19:31....
The hours stored in the real file are stored in numeric format like 235959
for 23:59:59. Is there a better way of doing this thing...
Sincerely yours,
Patrice Bourdages
Information Systems Analyst
Industrial Alliance, car and home insurance
(418) 650-4600 ext.3216
|