Give Hein 10 points.
Just FYI, if you use .lts. for the comparison, make sure that COMPARISON time is used for the DAY, not ABSOLUTE time. Hein's example is correct, since COMPARISON is the default, but see what happens when ABSOLUTE is specified.
$ ts="02-JUN-2009 15:12:59.04"
$ write sys$output f$cvtime(ts,,"DAY")
02
$ write sys$output f$cvtime(ts,"COMPARISON","DAY")
02
$ write sys$output f$cvtime(ts,"ABSOLUTE","DAY")
2
$
If you use .lt. 8 instead of .lts. "08" then either format will work.
Oh, and if you want the last Friday of the month, the following works
$ ts = f$cvtime("+1-0","ABSOLUTE")
$ sho sym ts
TS = "29-MAY-2009 16:43:02.27"
$ if f$cvtime(ts,,"WEEKDAY") .eqs. "Friday" .and. f$cvtime("''ts'+7-0",,"DAY") .lt. 8 then write sys$output "''ts' is last Friday of
Month"
29-MAY-2009 16:43:02.27 is last Friday of Month
$ ts = f$cvtime("+8-0","ABSOLUTE")
$ sho sym ts
TS = "5-JUN-2009 16:42:06.90"
$ if f$cvtime(ts,,"WEEKDAY") .eqs. "Friday" .and. f$cvtime("''ts'+7-0",,"DAY") .lt. 8 then write sys$output "''ts' is last Friday of
Month"
$
it depends