Introduction

Before the freshly come “workload manager”  feature on latest Control-M versions, the Control-M users used a lot of workarounds to manage the workload execution.

Using Quantitative resources was one of the most used.

Request

We need to trigger a workflow on demand without having to hold the jobs or release them manually.

For example, launch it and stop it at specifics time (on demand).
Or preventing side effect if an operation that can impact the application is scheduled (holding the workflow then release it)

Solution

Create 2 jobs updating quantitative resources for the application (workflow) we want to trigger.

Quantitative resource creation

Definition

A quantitative resource represents a measure that can be quantified such as percentage of CPU, megabytes of storage, or number of tape drives. It provides the ability to avoid overwhelming the physical and logical resources in an environment by limiting the number of jobs that use the same resource at the same time.

Cmdline method

Using ecaqrtab utility to list the existing QR:
Under control user :

CTMSRVCENTOS% ecaqrtab list

Date: 15-Jun-2020.   Page: 1




Quantitative resource list




+-------------------------------------------------------------------------------------------------+

Resource Name                                                       Max-Avail  Reserved Used Free

+-------------------------------------------------------------------------------------------------+

Using ecaqrtab utility to create your QR (here named QRSTOP):

CTMSRVCENTOS%

CTMSRVCENTOS% ecaqrtab ADD QRSTOP




Total :99

Quantitative resource 'QRSTOP', Max availability '99' was added.

CTMSRVCENTOS%

 

Check if QR is created :

CTMSRVCENTOS% ecaqrtab LIST
Date: 17-Jun-2020.   Page: 1

Quantitative resource list

+-------------------------------------------------------------------------------------------------+
 Resource Name                                                       Max-Avail  Reserved Used Free
+-------------------------------------------------------------------------------------------------+
 QRSTOP                                                              99         0        0    99

CTMSRVCENTOS%

Using GUI method

By selecting tools in monitoring pane:

Click on add resource and define resource name Control-M server name and maximum resources you want to allocate.

Note

If you did the cmdline method, your resource will be displayed as well in QR( quantitative resource )  part.

This first step done; we will assign the jobs which will be managed by this resource.

QR allocation

Affect to all job by find and update method ( see my previous topic ) the QR created above. ( QRSTOP )

Each job must need 1 QR to be submitted.

The aim is to switch the maximum QR from 99 to 0 in order to block the workflow.

Starting from that it will be easy to manage when this application can be triggered.

Assigning QR to your workflow

For our example I will create an Application composed by jobs that will depend of QR.

I will use the mass create option to create 10 jobs with QR assigned:

Note

Ton increment the jobs you can use the syntax JOBNAME{Counter} don’t forget the Uppercase for “C”or it will not work

To assign the QR to the jobs , add it to prerequisites part with the quantity needed and the total amount (here, 1 QR per job and total amount 99 )

Use jobs to update QR

Now we have all jobs depending of the CR we will create 2 jobs: 1 that update QR to 99 and another that update QR to 0 (which will block the workflow)

Command to use in the job will be

To update Quantitative resource ‘QRSTOP’ to 99:

CTMSRVCENTOS% ecaqrtab UPDATE QRSTOP 99
Quantitative resource 'QRSTOP', was updated from '0' to '99'

To reset the Quantitative resource ‘QRSTOP’ to 0:

CTMSRVCENTOS% ecaqrtab UPDATE QRSTOP 0

Quantitative resource 'QRSTOP', was updated from '99' to '0'.

For more security you can configure your QR jobs to be launched manually (or define a specific   time to start)

We can see that jobs are waiting for the QR that we defined (QRSTOP) as for the moment total amount is 0.

To submit these jobs, all that remains to be done is to release the job JOB_TEST_QR_TO_99

Result

The jobs are submitted as expected:

To stop the workflow, we can start run the JOB_TEST_QR_TO_0.
This will reset the QR in order to stop the workflow.
 

Note

Now you can set as you want the execution time of your “QR manager” 😊: JOB_TEST_QR_TO_0 and JOB_TEST_QR_TO_99.
Depending of your need you can modulate it

Example

Configure the QR job JOB_TEST_QR_TO_99 to be submitted at 08h00 then define the QR job JOB_TEST_QR_TO_0  to be scheduled at 19h00.

Conclusion

This method can be used on any Control-M version, but now with the new feature Control-M workload manager you have way more option to configure your workflow.
For next topics we will check another method to schedule your applications at specifics times.
Feel free to check dbi’s bloggers many interesting subject on Control -M , database and many other technologies!