home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!gatech!paladin.american.edu!auvm!UNC.BITNET!UNCDFC
- Message-ID: <SAS-L%92082611114056@VTVM2.BITNET>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 26 Aug 1992 10:40:00 EDT
- Reply-To: "Keith J. Brown" <UNCDFC@UNC.BITNET>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: "Keith J. Brown" <UNCDFC@UNC.BITNET>
- Subject: Re: SAS time values
- Lines: 62
-
- Deb,
- I think this might help solve your problem, or at least most of
- it. I thought TIME10. would print the fractions of seconds, but
- it doesn't seem to do that part.
-
- Keith Brown
-
-
- 1 OPTIONS LS=80;
- 2 DATA ONE;
- 3 INPUT TIME;
- 4 LIST;
- 5 H=INPUT(SUBSTR(PUT(TIME,Z7.),1,2),2.);
- 6 M=INPUT(SUBSTR(PUT(TIME,Z7.),3,2),2.);
- 7 S=INPUT(SUBSTR(PUT(TIME,Z7.),5,3),3.1);
- 8 TIME1=HMS(H,M,S);
- 9 FORMAT TIME1 TIME10.;
- 10 CARDS;
-
- RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+---
- 11 1022011
- 12 1025012
- 13 1208593
- 14 0308594
- NOTE: The data set WORK.ONE has 4 observations and 5 variables.
- NOTE: The DATA statement used 0.08 CPU seconds and 3708K.
-
- 15 ;
- 16 PROC PRINT UNIFORM;
- NOTE: The PROCEDURE PRINT printed page 1.
- NOTE: The PROCEDURE PRINT used 0.02 CPU seconds and 3805K.
-
- NOTE: The SAS session used 0.29 CPU seconds and 3805K.
- NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
- The SAS System 1
- 10:31 Wednesday, August 26, 1992
-
- OBS TIME H M S TIME1
-
- 1 1022011 10 22 1.1 10:22:01
- 2 1025012 10 25 1.2 10:25:01
- 3 1208593 12 8 59.3 12:08:59
- 4 308594 3 8 59.4 3:08:59
-
- > ----------------------------------------------------------------------
- > CONTENT: question
- > SUMMARY: how to convert numeric to time values
- > REL/PLTF: 5.18/MVS 6.06/MVS 6.07/MVS 6.06/OS/2 6.04/PC-DOS
- > E-ADDR: adpdkhts@uiamvs.bitnet
- > NAME: Deb Cannon
- > PHONE: 319-335-6321
- > ----------------------------------------------------------------------
- >
- > I've RTFM'd until I'm blue in the face, and have come up empty.
- > I'm quite sure the answer is right in front of me, but.....
- >
- > I have a 4-byte packed decimal field representing time in
- > HH:MM:SSS. Have tried all sorts of gyrations of INPUT and
- > PUT functions, to no avail. I'd like to convert it into a
- > SAS time value. Can someone enlighten me?
- >
- > Deb
-