3 Replies Latest reply on Apr 18, 2018 9:50 PM by MunKeong Lee

    AVG_TIME Control-M Variable

    Andrea Franchi

      Hi everyone.

      I have included the %%AVG_TIME Control-M variable to our notifications for when a job exceeds the average runtime. The body of message is as following:

      %%JOBNAME has exceeded 25% average runtime - %%AVG_TIME

       

      The value actually changes from day to day, but it's always the same reagardless of the job.I would expect to see the average runtime for each job.

       

      By looking for more information about the use of Control-M variables, I have found that average runtime is calculated in seconds for previous runs of the current job or group scheduling table. I wonder if I am actually getting information about the average runtime for the scheduling table.

       

      Is there anything I need to change in the body of the message in order to retrieve the average runtime for the job only?

       

      Thanks,

      Andrea

        • 1. Re: AVG_TIME Control-M Variable
          MunKeong Lee

          Hi Andrea

          The average runtime of jobs are obtained only after executing ctmjsa. Usually a daily job is scheduled in Control-M to automatically execute ctmjsa "*" at a particular time. %%AVG_TIME will only be up to date after executing ctmjsa. For example, if a job executes multiple times per day, %%AVG_TIME will remain until it's updated with another execution of ctmjsa.

          Regards,

          MK

          1 of 1 people found this helpful
          • 2. Re: AVG_TIME Control-M Variable
            Andrea Franchi

            Hi MK.

            Thanks for your reply.

             

            ctmjsa is scheduled to run on a daily basis: in fact, I see the value retrieved change from one day to the other.

            The issue occurs when more than a job send that type of notification on the same ODATE.

             

            For instance, this is what I got from 2 different jobs which ran on the same day:

            • Job 1 - Mail message from CONTROL-M: Job 1 has exceeded 25% average runtime - 577.66
            • Job 2 - Mail message from CONTROL-M:Job 2 has exceeded 25% average runtime - 577.66

             

            577.66 is the value retrieved through %%AVG_TIME variable.

            The body of message is as following:

            %%JOBNAME has exceeded 25% average runtime - %%AVG_TIME

             

            Any idea of why the average runtime is the same for 2 different jobs?

            They have completely different runtimes.

             

            Thanks,

            Andrea

            • 3. Re: AVG_TIME Control-M Variable
              MunKeong Lee

              Hi Andrea

              Not sure why %%AVG_TIME are the same for the 2 jobs. To investigate, you can retrieve the average runtime by executing the utility ctmstats on the Control-M server. Try the following 2 commands:

              1. ctmstats -list "*" -jobname <name of job 1>

              2. ctmstats -list "*" -jobname <name of job 2>

              %%AVG_TIME should be the same value as the average elapsed time shown by the above commands.

              Regards,

              MK