T.R | Title | User | Personal Name | Date | Lines |
---|
303.1 | No magic needed here | WHYVAX::HAMPTON | | Tue Sep 02 1986 16:56 | 30 |
| If you make the user enter the time exactly as SUBMIT expects it,
you won't need any magic. Actually, this is probably the most
reasonable approach. You can use absolute, delta, or combination
time. Absolute time format is:
[dd-mmm-yyyy[:]][hh:mm:ss.cc]
or the keywords
TODAY
TOMORROW
YESTERDAY
For example, 15-APR-1986:12 is 12 noon on April 15, 1986. 15-::30
is 00:30 o'clock on the 15th day of the current month.
Delta time format is
[dddd-][hh:mm:ss.cc]
The "dddd" is days. For example, 3- is three days from now. 3-:30
is three days and thirty minutes from now. You cannot use delta
time in the SUBMIT command (I don't think).
Finally, combination time is absolute plus or minus a delta time.
For example, +5 is current time plus five hours. 15-APR:+:5 is
12:05 AM on April 15th of the current year. TOMORROW+1-00:00 is
tomorrow plus one day.
Hope this helps.
|
303.2 | A real example | FROST::HARRIMAN | ACK Phfft! | Wed Sep 03 1986 12:04 | 22 |
| The actual "how to" approach can be something like this:
$ read/prompt="What time would you like this to submit"/err=...-
sys$command submit_time
$ submit_time = f$edit(submit_time,"UPCASE,TRIM")! filter input
$ if submit_time .eqs. "" then submit_time = "0" ! null = now
$ if f$locate(submit_time,"f$").ne.f$length(submit_time) then -
goto gotcha ! anti-hacker code
$ if f$locate(submit_time,"@").ne.f$length(submit_time) then -
goto gotcha ! ditto
$ submit/after='submit_time' 'file_to_submit'
....
Although you cannot use delta times in the submit command, "0"
in the /AFTER switch means "now". Hope it helps.
/pjh
|
303.3 | It was five minutes work... | MDR292::WALL | I see the middle kingdom... | Wed Sep 03 1986 14:12 | 5 |
|
Thanks to all. Remembering that putting something in single quotes
is how to get its value was my only hurdle.
Dave W.
|
303.4 | you forget "'", but here's a better way | REGINA::OSMAN | and silos to fill before I feep, and silos to fill before I feep | Wed Sep 03 1986 15:57 | 19 |
| > $ if f$locate(submit_time,"f$").ne.f$length(submit_time) then -
> goto gotcha ! anti-hacker code
> $ if f$locate(submit_time,"@").ne.f$length(submit_time) then -
> goto gotcha ! ditto
>
> $ submit/after='submit_time' 'file_to_submit'
"f$" and "@" are an incomplete list of things you need
to check to avoid "gotchas". You need to check for "'" too
(apostrophe). Perhaps a more elegant solution, one that doesn't
require you to know which tidbits you need to check for, is this:
$ on warning the goto gotcha
$ submit_time = f$cvtime (submit_time)
$ submit/after='submit_time' 'file_to_submit'
e /Eric
|
303.5 | Nit. "0" = previous midnight, not now. | DELNI::CANTOR | Dave Cantor | Thu Sep 04 1986 01:08 | 15 |
| Re .2
> Although you cannot use delta times in the submit command,
> "0" in the /AFTER switch [sic] means "now". Hope it helps.
"0" in the /AFTER qualifier means midnight today; _i.e._,
00:00:00.00 of the current day. However, that is always either
"right now" or in the past and has the effect of scheduling
the job to be run immediately, as intended.
Also, you certainly *can* use delta times in the submit command;
_e.g._, $ SUBMIT/AFTER="+1-2:0" ! 26 hours from now
$ "TOMORROW+8" ! 8:00 a.m. tomorrow
Dave C.
|
303.6 | picky, picky... | FROST::HARRIMAN | ACK Phfft! | Thu Sep 04 1986 16:03 | 34 |
| re: .5
I stand corrected. Quote from DCL-780:
"You can specify either an absolute time or a combination of
absolute and delta times. see Section 2.5 for complete information
on specifying times and values" - that's NOT just delta times according
to them!
verbatim from VMSHELP 4.4:
SUBMIT
/AFTER=absolute-time
/NOAFTER
Holds the job until the specified time. If the time has passed,
processes the job immediately. Time can be an absolute time or a
combination of absolute and delta times.
Besides, we are arguing semantics. if "0" means midnight and it's
past midnight, the job will start. Therefore it means "now". Isn't
it just as easy to say one thing as the other? they're both right.
re: .4
yeah, I know that's not all you have to look for, however, without
knowing how much Dave is letting the users get into in the first
place you may or may not have to check for the "other" stuff...
Checking for time using f$time is a better idea (that means you're
right, Eric)
Gods, you hackers are such perfectionists!
|