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

First Friday of month

Go to solution
James T Horn
Frequent Advisor

First Friday of month

Anyone know how I can check to see if the current date is the first friday of the month in DCL?
Hein van den Heuvel
Honored Contributor

Re: First Friday of month

$IF F$CVTIME(,,"WEEKDAY") .EQS. "Friday" -
.AND. F$CVTIME(,,"DAY") .LTS. "08"

Jan van den Ende
Honored Contributor

Re: First Friday of month


from your Forum Profile:

I have assigned points to 19 of 56 responses to my questions.

Maybe you can find some time to do some assigning?


Mind, I do NOT say you necessarily need to give lots of points. It is fully up to _YOU_ to decide how many. If you consider an answer is not deserving any points, you can also assign 0 ( = zero ) points, and then that answer will no longer be counted as unassigned.
Consider, that every poster took at least the trouble of posting for you!

To easily find your streams with unassigned points, click your own name somewhere.
This will bring up your profile.
Near the bottom of that page, under the caption "My Question(s)" you will find "questions or topics with unassigned points " Clicking that will give all, and only, your questions that still have unassigned postings.

Thanks on behalf of your Forum colleagues.

PS. nothing personal in this. I try to post it to everyone with this kind of assignment ratio in this forum. If you have received a posting like this before please do not take offence none is intended!

PPS. Zero points for THIS entry, please.


Have one on me.

Don't rust yours pelled jacker to fine doll missed aches.
Jon Pinkley
Honored Contributor

Re: First Friday of month

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")
$ write sys$output f$cvtime(ts,"COMPARISON","DAY")
$ write sys$output f$cvtime(ts,"ABSOLUTE","DAY")

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
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
it depends