How to find an ORDERID using a scheduled job?

All questions about Control-M jobs definitions
Post Reply
User avatar
bsglover
Nouveau
Nouveau
Posts: 14
Joined: 01 Dec 2011 12:00

How to find an ORDERID using a scheduled job?

Post by bsglover » 01 Dec 2011 10:54

Hi guys,
i need to put a job in hold state just after another execution finish KO, i did get the right command:

"ctmpsm -UPDATEAJF (ORDER-ID) HOLD"

I dont know how to get, in automatic, the order_id of the job i need to hold.

My idea is create a script which can be launched after the other execution finish KO. The KO job has a monthly schedule and the one i have to hold has a daily execution (the last one of a whole flow).

System info:
Win server 2003 sp3
Control-m 6.4

Thanks in advance for the advices.

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 09 Dec 2011 12:31

Bsglover,

The orderid of the target job is accessible from the CMR_AJF table. The value returned is numeric, instead of alphanumeric. For example, if your target job has an orderid of abc, the returned value will be 13368.

The ctmpsm utility accepts decimal orderids: in that case, the value should be prefixed with an asterisk and enclosed in doublequotes, as shown below:

ctmpsm –updateajf “*13368” hold

You have to strictly identify your target (daily) job using as many SQL selection criteria as required such as the jobname, the application, the odate etc…

Running an sql sequence such as:

select ‘ctmpsm –updateajf “*’
+ ltrim(str(ORDERNO)
+ ‘” hold’
where APPLIC = (your application)
and ODATE = (YYYYMMDD)
and JOBNAME = (your daily jobname)
.. will give you directly the required command.

If you are using MS/SQL I could forward you a kind of sample which works

Cheers
Nicolas Mulot

User avatar
bsglover
Nouveau
Nouveau
Posts: 14
Joined: 01 Dec 2011 12:00

Post by bsglover » 09 Dec 2011 12:38

Thanks for the answer, i will try asap. :D

Post Reply