[Info-vax] how to do a search for just today's info
Paul Sture
nospam at sture.ch
Thu Jan 29 06:39:29 EST 2015
On 2015-01-28, rdpiccard at gmail.com <rdpiccard at gmail.com> wrote:
> On Wednesday, January 28, 2015 at 1:45:05 PM UTC-5, Stephen Hoffman wrote:
>> On 2015-01-28 17:59:51 +0000, pcoviello said:
>>
>
> [snip]
>
>>
>> OK. If those assumptions of mine are correct, then this should get you
>> close to where you want:
>>
>> $ slashes = f$cvtime(,,"MONTH") + "/" + f$cvtime(,,"DAY") + "/" +
>> f$extract(2,2,f$cvtime(,,"YEAR"))
>> $ show symbol slashes
>> SLASHES = "01/28/15"
>> $
>>
>> This probably used with something like the following command:
>>
>> $ PIPE SEARCH sys$scratch:cconsole.tmp today | search sys$pipe
>> "''slashes'" /output=sys$scratch:cconsole-today.tmp
>>
>> If you're using a crappy font, that's a vertical bar in there, and then
>> there's a double quote, and two single quotes, the symbolname slash, a
>> single quote, and a double quote.
>>
>> The quoting is used as DCL treats the slash as a special character.
>>
>> #########
>>
>
> [snip]
>
>
> A possible corner case: if the command
>
> $ slashes = f$cvtime(,,"MONTH") + "/" + f$cvtime(,,"DAY") + "/" +
> f$extract(2,2,f$cvtime(,,"YEAR"))
>
> is executed so as to span from before to after the stroke of midnight
> at the end of the last day of a month (or year), might it produce
> misleading results? In other words, do each of the f$cvtime
> executions take the then-current time, or is the time when the first
> one executes used by all?
FWIW I usually put calls to get today's date (and time) at the beginning
of such a procedure, so that it's clear it's outside the processing loop.
Then if I need the current time in the context of a lengthy job, I'll
put that somewhere obvious. Comments explaining why such code is in
that particular spot help greatly when you revisit the code later.
And as Hoff mentions, adding 5 or 10 minutes to batch jobs submitted for
tomorrow avoids problems where the execution queue's system has a
slightly different time than the submitting system. I used to add
15 minutes in the days before we had NTP or similar mechanisms
available.
--
Of dates and times:
%S - Second as decimal number (00–61), allowing for up to two leap-seconds
(but POSIX-compliant implementations will ignore leap seconds)
More information about the Info-vax
mailing list