Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Times in a Command Procedure

SOLVED
Go to solution
Doug Raymond
Occasional Visitor

Adding Times in a Command Procedure

Is there a good way to add times in a command procedure?

I want to schedule a procedure to run fifteen minutes after the last revision date on a file. I get the revision date using F$FILE_ATTRIBUTES, and I can put in the string for fifteen minutes. The only way I can see to add these times is to convert the parts of the strings to integer and work with those and convert it back.
4 REPLIES
Hein van den Heuvel
Honored Contributor
Solution

Re: Adding Times in a Command Procedure

Check out "$help dcl date comb"
Example:

$ write sys$output f$file("tmp.tmp","CDT")
22-DEC-2004 16:49:54.84

$ write sys$output f$cvtime(f$file("tmp.tmp","CDT"))
2004-12-22 16:49:54.84

$ write sys$output f$cvtime(f$file("tmp.tmp","CDT"), "absolute")
22-DEC-2004 16:49:54.84

$ write sys$output f$cvtime(f$file("tmp.tmp","CDT") + "+0 0:15:0","absolute")
22-DEC-2004 17:04:54.84


hth,
Hein.
Robert Gezelter
Honored Contributor

Re: Adding Times in a Command Procedure

Doug,

The syntax would be:

$ SUBMIT filename/AFTER:"dd-mmm-yyyy:hh:mm:ss+deltadays-deltahours:deltaminutes:deltaseconds"

In other words, assuming the file was revised at 1-MAR-2005:16:00:00, and you wanted it to run 15 minutes later, the command would be:

$ SUBMIT filename/AFTER:"1-MAR-2005:16:00:00+0-0:15:00"


- Bob Gezelter, http://www.rlgsc.com
Doug Raymond
Occasional Visitor

Re: Adding Times in a Command Procedure

Thanks. This appears to be the combination time to which Help and the manuals refer, but do not illustrate.

I coded the alternative (converting to integer, . . .). It works, but is it ever UGLY!

Thanks again.
Doug Raymond
Occasional Visitor

Re: Adding Times in a Command Procedure

Your answers give me plenty to work with. Thanks again.