Date: Fri, 15 Aug 1997 09:32:30 GMT
Reply-To: Piet Zuidervaart <p.zuidervaart@FORTIS.NL>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Piet Zuidervaart <p.zuidervaart@FORTIS.NL>
Organization: NLnet
Subject: Re: SAS date display problem
Pamela,
The statement should be:
UDATE = FLOOR(SYS_TIME/86400);
A datetime value represents seconds, so a day (24 hours) is 86400
seconds.
Good luck.
Piet Zuidervaart.
On Thu, 14 Aug 1997 17:45:55 -0400, Pamela A Mydock
<fclpam@NERSP.NERDC.UFL.EDU> wrote:
>Hello SASers,
>
>Please help a rookie struggling with an IBM binary date format problem.
>What I would like to do is pass RMFSTAMP8. date/time data to another
>variable in a SAS format, so eventually I can extract unique dates and
>days of the week. Here is an excerpt of the code and a sample of the
>output.
>
>DATA ONE ;
> INFILE FILEIN ;
> INPUT @1 TASK PD4. /* TASK NUMBER-NNNNNNNC */
> @5 SYS_TIME RMFSTAMP8.; /* 0HHMMSSF,00YYDDDF--PD8. */
> FORMAT SYS_TIME DATETIME17. ;
> UDATE=SYS_TIME ;
> FORMAT UDATE DATE7. ;
> PROC PRINT;
>
>output sample looks like this:
>
>OBS TASK SYS_TIME UDATE
> 1 221 14AUG97:06:52:29 *******
> 2 225 14AUG97:06:52:40 *******
> 3 227 14AUG97:06:52:46 *******
> 4 231 14AUG97:06:52:55 *******
>
>
>Other information -- when I omit the DATETIME17. expression, the print out
>for SYS_TIME for observation 1 is 1187160749 and UDATE is 11871. Various
>other SUBSTR assignments for UDATE have yielded a date of 02Jul92, which
>apparently represents the SAS date value of 11871, but not 14AUG97!
>
>I have been bouncing around in a stack of SAS manuals (overwhelming!) and
>I cannot find the technique I need to get the correct display. So far
>only DATETIME17. gives me a printout with anything other than asterisks,
>but this format does not let me separate the date from the time so I can
>look for unique dates in sequence and capture activity by day of the week.
>
>Can anyone help me in my quest?
>
>Thanks, Pam
>
>-----------------------------
>Pamela Mydock
>fclpam@nersp.nerdc.ufl.edu
>-----------------------------
|