From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX"  5-MAY-1992 12:50:03.35
To:	STEVENS@RAD.HUP.UPENN.EDU, info-vax@sri.com
CC:	GWDGI::"info-vax@sri.com"@CRVAX.SRI.COM, MOELLER@CRVAX.SRI.COM
Subj:	RE: Re-formatting F$GETJPI(pid,"CPUTIM")

Fred Stevens <STEVENS@RAD.HUP.UPENN.EDU> asks:
> Is there a VMS lexical which will re-format the CPUTIM returned
> by F$GETJPI("","CPUTIM") into an HH:MM:SS.CC string?

Not really. But there is a neat & unobvious method, which does respect
the fact that the number returned by $GETJPI is actually *unsigned*:

$ ticks = f$getjpi("","cputim")
$!
$ L[ 0,32] = ticks
$ Q[ 0,32] = -100000 * f$cvui( 0,11,L)
$ if ticks.eq.0 then Q[0,32] = -1
$ Q[11,32] = -100000 * f$cvui(11,11,L) + f$cvsi(11,21,Q)
$ Q[22,32] = -100000 * f$cvui(22,10,L) + f$cvsi(22,21,Q)
$ Q[54,10] = -1
$!
$ write SYS$OUTPUT f$fao("!%D",f$cvui(32,32,f$fao("!AD",8,Q)))

Wolfgang J. Moeller, GWDG, D-3400 Goettingen, F.R.Germany | Disclaimer ...
PSI%(0262)45050352008::MOELLER      Phone: +49 551 201516 | No claim intended!
Internet: moeller@gwdgv1.dnet.gwdg.de   | This space intentionally left blank.

