For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2006 > COMBINED-DATETIME anomaly ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author COMBINED-DATETIME anomaly ?
Roger While

2006-08-09, 3:55 am

Can somebody tell me what this is supposed to return ?

15.15 COMBINED-DATETIME function
The COMBINED-DATETIME function combines a value in integer date form and a
time in standard numeric time
form into a single numeric item into a common form.
The type of this function is numeric.

15.15.1 General format

FUNCTION COMBINED-DATETIME ( argument-1 argument-2 )

15.15.2 Arguments

1) Argument-1 shall be in integer date form.
2) Argument-2 shall be in standard numeric time form.

15.15.3 Returned values

1) The equivalent arithmetic expression is as follows:
argument-1 + (argument-2 / 100000)



argument-2 contains seconds-past-midnight (standard numeric time form),
so we divide maximum 86400 by 100000 giving 0.
Result is argument-1.
Hmm.

Roger


William M. Klein

2006-08-09, 3:55 am

I think this is trying to put the "integer date" to the left of the decimal
point an the time past midnight to the right of the decimal point.

Does that help?

--
Bill Klein
wmklein <at> ix.netcom.com
"Roger While" <simrw@sim-basis.de> wrote in message
news:ebc3gs$eeg$03$1@news.t-online.com...
> Can somebody tell me what this is supposed to return ?
>
> 15.15 COMBINED-DATETIME function
> The COMBINED-DATETIME function combines a value in integer date form and a
> time in standard numeric time
> form into a single numeric item into a common form.
> The type of this function is numeric.
>
> 15.15.1 General format
>
> FUNCTION COMBINED-DATETIME ( argument-1 argument-2 )
>
> 15.15.2 Arguments
>
> 1) Argument-1 shall be in integer date form.
> 2) Argument-2 shall be in standard numeric time form.
>
> 15.15.3 Returned values
>
> 1) The equivalent arithmetic expression is as follows:
> argument-1 + (argument-2 / 100000)
>
>
>
> argument-2 contains seconds-past-midnight (standard numeric time form),
> so we divide maximum 86400 by 100000 giving 0.
> Result is argument-1.
> Hmm.
>
> Roger
>



Roger While

2006-08-09, 3:55 am

You "think" this is so or you "know" this is so ? :-)
If this is so that it is intended that the seconds become
decimals, then I don't see what this is trying to do or what
it can be used for.
Consider seconds = 86400 (ie. a full day) at day 1.
According to this we would get 1.864 whereby I would
expect 2.0 or ?
..864 of what ? apples, oranges ?
Or eg. Day 1 second 1 -
We get 1.000001

You see the problem ?

Roger

"William M. Klein" <wmklein@nospam.netcom.com> schrieb im Newsbeitrag
news:dEgCg.359084$GD7.61227@fe08.news.easynews.com...
>I think this is trying to put the "integer date" to the left of the decimal
>point an the time past midnight to the right of the decimal point.
>
> Does that help?
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:ebc3gs$eeg$03$1@news.t-online.com...
>
>



Rick Smith

2006-08-09, 7:55 am


"Roger While" <simrw@sim-basis.de> wrote in message
news:ebc6s3$las$03$1@news.t-online.com...
> You "think" this is so or you "know" this is so ? :-)
> If this is so that it is intended that the seconds become
> decimals, then I don't see what this is trying to do or what
> it can be used for.
> Consider seconds = 86400 (ie. a full day) at day 1.
> According to this we would get 1.864 whereby I would
> expect 2.0 or ?
> .864 of what ? apples, oranges ?
> Or eg. Day 1 second 1 -
> We get 1.000001
>
> You see the problem ?


Yes. Unfortunately you seem to be making more of it
than it is.

WD 1.6, page 846, D.27.4.9 COMBINED-DATETIME
function,
"The COMBINED-DATETIME function accepts two
arguments - a date in integer date form, and a time in standard
numeric time form - and returns a numeric value in which the
date occupies the integer part of the value and the time
represents the fractional part, according to the expression
argument-1 + (argument-2 / 100000). For example, given the
integer date form value 143951 (representing the date
February 15, 1995) and the standard numeric time form value
18867.812479168304 (representing the time
05:14:27.812479168304), the returned value would be exactly
143951.18867812479168304. The intent of this function is to
provide a standard numeric representation of a combined date
and time in a single variable, for any date from January 1, 1601
onward, to at least nanosecond precision."



Roger While

2006-08-09, 7:55 am

Fine, and what exactly can I do with this ?

Roger

"Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
news:12djdbnqldd0q56@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:ebc6s3$las$03$1@news.t-online.com...
>
> Yes. Unfortunately you seem to be making more of it
> than it is.
>
> WD 1.6, page 846, D.27.4.9 COMBINED-DATETIME
> function,
> "The COMBINED-DATETIME function accepts two
> arguments - a date in integer date form, and a time in standard
> numeric time form - and returns a numeric value in which the
> date occupies the integer part of the value and the time
> represents the fractional part, according to the expression
> argument-1 + (argument-2 / 100000). For example, given the
> integer date form value 143951 (representing the date
> February 15, 1995) and the standard numeric time form value
> 18867.812479168304 (representing the time
> 05:14:27.812479168304), the returned value would be exactly
> 143951.18867812479168304. The intent of this function is to
> provide a standard numeric representation of a combined date
> and time in a single variable, for any date from January 1, 1601
> onward, to at least nanosecond precision."
>
>
>



Rick Smith

2006-08-09, 7:55 am


"Roger While" <simrw@sim-basis.de> wrote in message
news:ebcfar$kg6$00$1@news.t-online.com...
> Fine, and what exactly can I do with this ?


Use it as a time stamp wherever desired and use
it as input to other functions, such as, the
FORMATTED-DATETIME function,
INTEGER-OF-FORMATTED-DATE function,
SECONDS-FROM-FORMATTED-TIME function,
TEST-FORMATTED-DATETIME function, and
maybe some others I didn't locate.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com