HP OpenVMS Systems

ask the wizard
Content starts here

Tracking Batch Job Completion?

» close window

The Question is:

If I have a queue running which re-submits itself every hour and I tried using
 F$GETQUI to determine the time the job was completed (using
 JOB_COMPLETION_TIME) but I get something like
COMPLETED: 17-NOV-1858 00:00:00.00
My objective is to get the time the job was completed on each hour. Apparently,
 F$GETQUI cannot get this because the queue is resubmitted. Is there really a
 way to get the job completion time even if the queue resubmits itself or do i
 get this info instea
d from the log file created each time the job is ran?

The Answer is :

    It sounds to me like the F$GETQUI is running against the current job,
    not the previous job. Since the current job obviously hasn't yet
    completed, a zero completion time (17-NOV-1858) is  "reasonable".
    If the job resubmits itself, why not pass the completion time of the
    current job to the next job as a parameter?
    For example:
    $ ! note best practice for a resubmitting job is to do the resubmit at
    $ ! the beginning of the job so that unexpected failures don't break the
    $ ! chain. However, since we don't know the completion time yet,
    $ ! we'll have to remember the entry number to change the parameter later
    $ SUBMIT/AFTER="''F$TIME()+0-01:00" -
    $ NextJob=$ENTRY
    $ last_job_completed=p1
    $ ! job code goes here
    $ Completed=F$TIME()
    $ SET ENTRY 'NextJob' /PARAMETERS=("''Completed'")
    $ EXIT

answer written or last revised on ( 7-JAN-2004 )

» close window