Operating System - OpenVMS
1754021 Members
7798 Online
108811 Solutions
New Discussion юеВ

? F$DELTA_TIME returns a non-standard delta time format

 
SOLVED
Go to solution
Robert_Boyd
Respected Contributor

? F$DELTA_TIME returns a non-standard delta time format

Does anybody know WHY F$DELTA_TIME returns a string which is not a valid OpenVMS delta time value? This means that if someone wants to use the return value for anything they have to massage it to get the "-" between the day and time portions of the value. It would be much simpler to have the lexical stuff the connector in to begin with.

In general -- I would like to think that system routines that operate on time values will always return a valid time construct whether absolute or delta.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
24 REPLIES 24
Robert_Boyd
Respected Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

And ... another thing ... why is it that on V8.2 the HELP for the DCL WAIT command still doesn't mention that

$ WAIT

is also a valid command? It has worked as far back as I can remember ... and still works.

Is this an oversight? or a deliberate act of avoidance?

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Dale A. Marcy
Trusted Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

It will work if you enclose it in quotes with a + i.e.,

$ submit/after="+''f$delta_time(start,end)'" ...

start and end would be symbols containing the appropriate start and end times. I know the quotes are hard to distinguish sometimes in this forum, so I will repeat the above line below adding spaces between each type of quote above:

$ submit/after= " + ' ' f$delta_time(start,end) ' " ...
Robert_Boyd
Respected Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

Hmmmm ... that's an interesting proposition but I beg to differ ... for example:


$ say = "write sys$output"
$ say -
f$cvtime("+"+f$delta_time(f$cvtime("YESTERDAY","ABSOLUTE"),f$cvtime("TODAY","ABSOLUTE")))
%DCL-W-IVATIME, invalid absolute time - use DD-MMM-YYYY:HH:MM:SS.CC format
\+ 1 00:00:00.00\

Master you were right about 1 thing -- the negotiations were SHORT!
Robert_Boyd
Respected Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

I can't get the submit example to work either:

$ xa = f$cvtime("YESTERDAY","ABSOLUTE")
$ xb = f$cvtime("TODAY","ABSOLUTE")
$ submit/after="+''f$delta_time(xa,xb)'" login.com
%DCL-W-IVATIME, invalid absolute time - use DD-MMM-YYYY:HH:MM:SS.CC format
\+ 1 00:00:00.00\
Master you were right about 1 thing -- the negotiations were SHORT!
Dale A. Marcy
Trusted Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

Sorry, you are correct. In my testing, I did not make my delta time larger than a day and it worked fine in that case. Which is interesting, because I would have thought the 0 in the day position would have caused the same error.
John Gillings
Honored Contributor
Solution

Re: ? F$DELTA_TIME returns a non-standard delta time format

Robert,

Excellent point. F$DELTA_TIME is returning a "standard" delta time as returned by SYS$ASCTIM. It's implemented as

$BINTIM P1 => Time1
$BINTIM P2 => Time2
LIB$SUB_TIMES Delta,Time1,Time2
$ASCTIM Delta => Output String

The trouble here is that DCL has extended the standard time string formats, and requires delta times to have a hyphen between the days and time fields.

It seems reasonable that it should return a delta time in DCL delta time format, rather than $ASCTIM format, and maybe trim off any leading white space at the same time. I'll send a suggestion to the engineer responsible.

(since F$DELTA time is new, hopefully not too many people have written code dependent on the output format, otherwise we might need to add a flag "DCL" to request a DCL format string)
A crucible of informative mistakes
Guy Peleg
Respected Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

Hi Robert,

Thank you for bringing this to our attention.

I have exchanged mail with John Gillings
based on his feedback I'll modify F$DELTA_TIME
to accept an optinal format argument

F$DELTA_TIME(start-time,end-time [,format])

format = "DCL" or "ASCTIM" (default)

This will show up in a future DCL kit for
V8.2 and V7.3-2 and will be incorporated
into the next VMS version.

Regards,

Guy Peleg
OpenVMS Engineering
Jan van den Ende
Honored Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

Robert,

Grab your chance!!

Give Guy (at least) 4 points, and see hime get his (WELL deserved) hat!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Jan van den Ende
Honored Contributor

Re: ? F$DELTA_TIME returns a non-standard delta time format

Guy,

this thread set me thinking.

At this moment, F$DELTA is returning a time syntax, and you just promised to add a format specifier for ASCTIM or DCL format.

Would it be asking very much extra to add (more or less like F$CVTIM) the format specifiers SECONDS, MINUTES, HOURS, DAYS (WEEKS?, MONTHS?, YEARS?) as rounded-down integer values? I know for sure that at least _WE_ have regular use for them!
I know that this would be fairly easy to do in DCL, but it DOES require a number of string manipulations and arithmatic, and I have for a long time already been pleased with those formats from f$cvtime.

TIA

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.