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 (February 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 10 Feb 2003 15:37:40 +0100
Reply-To:     Peter Crawford <peter.crawford@DB.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Peter Crawford <peter.crawford@DB.COM>
Subject:      Re: DHMS
Comments: To: Howard_Schreier@ITA.DOC.GOV, mmsya@AOL.COM,
          paul_dorfman@HOTMAIL.COM
Content-type: text/plain; charset=iso-8859-1

thanks Howard I'm reminded again to review functions and formats !

Of course, with the way that dhms() works, there should be no need for that minute() function there.

In fact, I think it's use, as suggested might not only be syntatically(minor) incorrect, but (imho more importantly) logically incorrect ! As Howard probably knows, but John <mmsya@AOL.COM> appears to have missed, function minute(58) would generate a zero (58, being in the first minute) and function hour(01) would similarly generate 0 ! That is because the parameter for both these functions is a sas time value (in secs) see onlinedoc at SI http://v8doc.sas.com/sashtml/lgref/z0245852.htm (register once, via http://www.sas.com/v8doc) If a parameter suitable for minute() is available(say TT ), it is probably TT, that should be used as the 4th parameter like... dhms(date,0,0,TT) Of course we _could_ build a datetime value by taking hour, minute and second from independent sources, but I think the intention was probably dhms( date, 1, 58, 0 ) which might also (more easily?) be used like dhms( date, 0,0, "1:58"t ) or, if "timeValue" is a variable holding a sas time value (7080) dhms( date, 0,0, timeValue )

but Howard, you knew that anyway ! ;-)

Regards (and thanks for reminding us about minute()

Peter Crawford

Datum: 10/02/2003 13:32 An: SAS-L@LISTSERV.UGA.EDU

Antwort an: Howard_Schreier@ITA.DOC.GOV

Betreff: Re: DHMS Nachrichtentext:

On Mon, 10 Feb 2003 05:54:55 +0000, Paul Dorfman <paul_dorfman@HOTMAIL.COM> wrote:

>John, > >The specification > >dhms (date,hour(01),min(58),0) > >would be syntactically invalid.

Not by much. If you replace MIN with MINUTE it's valid.

I think that MIN, MAX, and such functions should accept one, or even zero, arguments (not for the sake of the results, but to reduce the need to handle special cases in macro coding). If that were the case, the expression would be syntactically valid as presented.

>However, in the expression > >dhms (date, 01, 58, 0) > >01 means the 1st hour of the day, 58 means the 58th minute of the hour, and >0 means 0 seconds of the minute. As far as DATE goes, it must hold a valid >SAS date. > >Kind regards, >-------------------- >Paul M. Dorfman >Jacksonville, FL >-------------------- > >>From: Mmsya <mmsya@AOL.COM> >>Hi all, >> >>I have a simple question please. In the function DHMS >>(date,hour(01),min(58),0), what does hour(01) and min(58) mean, please. >> >>Thanks, >>John. > > >_________________________________________________________________ >MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. >http://join.msn.com/?page=features/virus

--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


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