[Info-vax] check date against an given age
BaxterD at tessco.com
BaxterD at tessco.com
Wed Nov 18 15:10:18 EST 2009
On Nov 13, 1:56 pm, Hein RMS van den Heuvel
<heinvandenheu... at gmail.com> wrote:
> On Nov 13, 10:16 am, DTL <didier.mora... at gmail.com> wrote:
> :
>
> > Now, considering the CPU time used with good old DCL and my Charon
> > emulator :-) I've better code that in Fortran as the file is 220 000
> > records big !
>
> Unless you are more comfortable with Fortran than DCL, I'd say not
> worth the hassle for a tiny 200k record file.You may want to pre-read
> it with search to load teh XFC cache, such that the DCL single block
> IO dos not slow it down.
>
> The only CPU intensive code in my example is the silly FAO formatting
> I added just for fun.
>
> The core algorithm is only:
>
> $ now = F$CVTIME(,,"DATE") - "-" - "-"
> :
> $loop:
> $read...
> :
> $ yymmdd = 10000*(1900+F$ELEM(2,slash,jjmmaa)) + -
> 100*F$ELEM(1,slash,jjmmaa) + F$ELEM(0,slash,jjmmaa)
> $ IF cutoff .GT. ('now' - 'yymmdd') / 10000
> $ THEN. ...
> :
>
> Cheers,
> Hein.
I'm kinda surprised that I haven't seen anyone mention the
"Comparison" option in f$cvtime()
i.e.
$ Time1 = f$cvtime("<first date/time>","Comparison",)
$ Time2 = f$cvtime("<second date/time>","Comparison",)
then boolian comparison can be done
$ If ( Time1 .les. Time2 ) then ...
I would imagine that a variation on this could be used to provide the
solution.
Dave
Dave
More information about the Info-vax
mailing list