[Info-vax] DCL Time Manipulation

Kenneth Fairfield ken.fairfield at gmail.com
Mon Aug 22 11:51:50 EDT 2011


On Aug 20, 11:54 pm, hel... at astro.multiCLOTHESvax.de (Phillip Helbig---
undress to reply) wrote:
> In article <mailman.15.1313608078.3397.info-vax_rbnsn.... at rbnsn.com>,
>
> Stafford Winters <stafford.winte... at frontier.com> writes:
> > On 8/17/2011 10:41 AM, James J. O`Shea wrote:
> > > I'm trying to get the amount of time a user is logged in monthy, using ACCOUNTNG. How can I get the sum of times in DCL?
> > I saw your previous post and had intended on replying, but just hadn't
> > gotten to it.  F$CVTIME() is not intended to do what you are trying to
> > accomplish.
>
> I'm surprised it works at all.

It works by accident...

If the original example use the alternative delta time with
the explicit hyphen between the days field and the time
field, you get an error:

LGCY01::Lhskhf> t1 = "0-06:00:00.00"
LGCY01::Lhskhf> t2 = "0-10:00:00.00"
LGCY01::Lhskhf> wo f$cvtime(t1+"+"+t2,,"time")
%DCL-W-IVATIME, invalid absolute time - use DD-MMM-YYYY:HH:MM:SS.CC
format
 \0-06:00:00.00+0-10:00:00.00\
LGCY01::Lhskhf>

Remove the hyphen from "t1", and it appears to work:

LGCY01::Lhskhf> t1 = "0 06:00:00.00"
LGCY01::Lhskhf> wo f$cvtime(t1+"+"+t2,,"time")
16:00:00.00
LGCY01::Lhskhf>

I don't know why F$CvTime is ignoring the leading
"0" in "t1", but it's clearly treating "t1" as an absolute
time, not a delta time.  That's an accident (or bug if will).

    -Ken



More information about the Info-vax mailing list