- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Lexical F$DELTA_TIME and "DCL" format selector
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2007 06:18 AM
тАО01-10-2007 06:18 AM
x = f$delta_time( f$time(), f$cvtime("+0-0:2","ABSOLUTE"),"DCL")
%DCL-W-SYMDEL, invalid symbol or value delimiter - check command syntax
Has this additional feature not been extended to V8.2 yet?
Thanks,
Robert
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2007 11:57 AM
тАО01-10-2007 11:57 AM
Re: Lexical F$DELTA_TIME and "DCL" format selector
This change was a result of your ITRC question in May 2005. I hassled Guy into implementing it ;-)
Since V8.2 had already been released at the time, Guy added the change to V8.3, and created updates for V7.3-2 and V8.2. I'm unsure if the V8.2 version ever got released into the wild. Make sure you're up to date with all DCL related patches.
If that fails, log a case with HP customer support asking for the V8.2 version of Guy's code (that's assuming they can find it!).
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2007 05:42 PM
тАО01-10-2007 05:42 PM
SolutionAs far as I recall, I made the change
to V8.3 and backported it to all remedial
releases. So far, no DCL kit has been released for V8.2 so the feature did not
get a chance to "ship". Contact HP and ask
for the latest DCL remedial image for V8.2,
the new image will include the "DCL" keyword.
Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2007 02:16 AM
тАО01-11-2007 02:16 AM
Re: Lexical F$DELTA_TIME and "DCL" format selector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2007 09:59 AM
тАО01-11-2007 09:59 AM
Re: Lexical F$DELTA_TIME and "DCL" format selector
$ EARLY = F$CVTIME(,,"TIME")
$ SHOW SYMBOL EARLY
$ LATER = F$CVTIME("+0-12:34:56",,"TIME")
$ SHOW SYMBOL LATER
$!Return delta time between EARLY and LATER
$ DELTA=F$CVTIME("''LATER'-''EARLY'",,"TIME")
$ SHOW SYMBOL DELTA
Try it. Believe it or not it works for all deltas < 24 hours, even if the day boundary is crossed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2007 07:47 PM
тАО01-11-2007 07:47 PM
Re: Lexical F$DELTA_TIME and "DCL" format selector
http://wwwvms.mppmu.mpg.de/~huber/util/main/f$delta_time.html
Binary for VMS 7.3-1 Alpha:
http://wwwvms.mppmu.mpg.de/util_root/exe/f$delta_time.exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2007 03:08 AM
тАО01-16-2007 03:08 AM
Re: Lexical F$DELTA_TIME and "DCL" format selector
That is a very interesting "magic"! I wrote a time difference calculating DCL procedure about 15 years ago -- now I've been able to shorten it considerably.
I wanted a procedure that is completely portable, so I've updated it to use F$DELTA_TIME when possible.
I'm attaching it here and will also post it on dcl.OpenVMS.org
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-16-2007 04:21 AM
тАО01-16-2007 04:21 AM
Re: Lexical F$DELTA_TIME and "DCL" format selector
Thanks for the pointer -- I'll contact Support this week and ask about the DCL patch update for V8.2.
As far as I can tell it didn't make it into the VMS82A_UPDATE V5.0 kit and I don't see a separate DCL kit so far.
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2007 08:48 AM
тАО01-17-2007 08:48 AM
Re: Lexical F$DELTA_TIME and "DCL" format selector
If your objective is to shorten the procedure, for pre F$DELTA_TIME versions, here are two possibilities. The attachment is "clean" DCL which determines the delta time by successive approximation using simple iteration on each field in the time. It's fairly obvious what it's doing.
For your amusement, the following is probably close to the shortest (and fastest?) possible procedure to do the job. It calculates the difference between absolute times P2-P1 (where P1 is required to be less than P2, not checked). Believe it or not, it's based on very sound theory and will work on all versions from V5 up for all pairs of times within the 10000 day range up to 20-OCT-9165 18:42:01.36. Although technically it uses an undocumented and unsupported trick, I'd be astonished if engineering ever breaks it.
$ ON WARNING THEN EXIT
$ tt=F$CVTIME(p1)
$ GOSUB x
$ b0=d
$ tt=F$CVTIME(p2)
$ GOSUB x
$ b1=d
$ d[32,32]=%XF0000000
$ d[0,32]=0
$ l0=F$CVUI(0,30,b0)
$ l1=F$CVUI(0,30,b1)
$ IF l0.LT.l1
$ THEN
$ d[0,30]=.NOT.((l1-l0).AND.%X3FFFFFFF)
$ d[30,30]=.NOT.(F$CVUI(30,30,b1)-F$CVUI(30,30,b0))
$ ELSE
$ d[0,30]=.NOT.((%X40000000+l1-l0).AND.%X3FFFFFFF)
$ d[30,30]=.NOT.(F$CVUI(30,30,b1)-F$CVUI(30,30,b0)-1)
$ ENDIF
$ delta==F$FAO("!%D",F$CVUI(32,32,F$FAO("!AD",8,d)))
$ SHOW SYM delta
$ EXIT
$ x:
$ d[32,32]=0
$ d[0,32]=0
$ b=60
$ Loop: d[b,1]=1
$ IF F$CVTIME(F$FAO("!%D",F$CVUI(32,32,F$FAO("!AD",8,d)))).GTS.tt THEN d[b,1]=0
$ b=b-1
$ IF b.GT.0 THEN GOTO loop
$ RETURN
(If someone asks nicely I'll post the version with comments explaining how it works ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-01-2007 12:55 PM
тАО04-01-2007 12:55 PM
Re: Lexical F$DELTA_TIME and "DCL" format selector
I would be interested in seeing the commented version of your version of an f$delta_time replacement using undocumented/unsupported features.
I made a slight modification to it, so it will use Jess Goodman's shortcut for delta times that are less than 24 hours. For those cases, that should be "faster".
Here's the modified version (with no comments).
$! dcl delta time calculator
$! based on http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1089731
$! using John Gillings' 64 bit binary time manipulation in DCL
$! and Jess Goodman's shortcut for delta times less than 24 hours
$!
$! p1 Earlier date_time
$! p2 Later date_time
$!
$! first check if the difference is < 24 hours, if so we can use shortcut
$
$ if f$cvtime("''p1'+1-0") .ges. f$cvtime(p2)
$ then ! use f$cvtime shortcut
$ EARLY = F$CVTIME(p1,,"TIME")
$ !SHOW SYMBOL EARLY
$ LATER = F$CVTIME(p2,,"TIME")
$ !SHOW SYMBOL LATER
$ !Return delta time between EARLY and LATER
$ DELTA==" 0 " + F$CVTIME("''LATER'-''EARLY'",,"TIME")
$ else
$ ON WARNING THEN EXIT
$ tt=F$CVTIME(p1)
$ GOSUB x
$ b0=d
$ tt=F$CVTIME(p2)
$ GOSUB x
$ b1=d
$ d[32,32]=%XF0000000
$ d[0,32]=0
$ l0=F$CVUI(0,30,b0)
$ l1=F$CVUI(0,30,b1)
$ IF l0.LT.l1
$ THEN
$ d[0,30]=.NOT.((l1-l0).AND.%X3FFFFFFF)
$ d[30,30]=.NOT.(F$CVUI(30,30,b1)-F$CVUI(30,30,b0))
$ ELSE
$ d[0,30]=.NOT.((%X40000000+l1-l0).AND.%X3FFFFFFF)
$ d[30,30]=.NOT.(F$CVUI(30,30,b1)-F$CVUI(30,30,b0)-1)
$ ENDIF
$ delta==F$FAO("!%D",F$CVUI(32,32,F$FAO("!AD",8,d)))
$ endif
$
$ SHOW SYMBOL/GLOBAL DELTA
$ EXIT
$ x:
$ d[32,32]=0
$ d[0,32]=0
$ b=60
$ Loop: d[b,1]=1
$ IF F$CVTIME(F$FAO("!%D",F$CVUI(32,32,F$FAO("!AD",8,d)))).GTS.tt THEN d[b,1]=0
$ b=b-1
$ IF b.GT.0 THEN GOTO loop
$ RETURN