HP OpenVMS Systems

ask the wizard
Content starts here

DCL Date Processing?

» close window

The Question is:

I need to know how to get the SUBMIT/AFTER
command to submit a job to a batch queue every first of the month - thanks for
 any assistance you can offer.  Here is what I have done so far $ y =
$ m = f$cvtime("TODAY","ABSOLUTE","MONTH")
$ nextmonth = f$cvtime ("''nextmonth'+32-","ABSOLUTE","DATE")
$ submitdate = f$edit(f$cvtime (nextmonth,,"day"),"UPCASE,COLLAPSE")
$ submitday = f$edit(f$cvtime (nextmonth,,"weekday"),"UPCASE,COLLAPSE")

The Answer is :

  One approach involves resumbitting the job daily, and simply
  checking to see if the current day is the first of the month:
    $ if f$int(f$cvt("TODAY",,"DAY")) .ne. 1 then EXIT
  Another could involve DCL similar to the following:
    $ WhichDay = F$Cvt("TODAY+31-","ABSOLUTE","DATE")
    $ MonthFirst =  F$Cvtime( F$Cvtime( WhichDay + -
                       "-"+F$Cvtime( WhichDay,,"DAY")+"-", -
                       "ABSOLUTE","DATE") + -
    $! and, if needed...
    $ MonthLast =  F$Cvtime( F$Cvtime( MonthFirst + -
                       "-"+F$Cvtime(MonthFirst+"+31-",,"DAY")+"-", -
                       "ABSOLUTE","DATE") + -
  You could easily replace the TODAY+31- used in the first line of DCL
  with some other required month, of course, and the remainder of the
  code would calculate the first and last day of that month.
  Various DCL-related resources are available, including the OpenVMS
  User's Guide and books from Digital Press.  Also see topic (6069).

answer written or last revised on ( 16-APR-2001 )

» close window