Page 1 of 1

How to get the orderno?

Posted: 15 Jan 2008 11:42
by updt1
Hello,

I want to get some information from the server database for a specific job. I am able to run a program after a job is submitted and before it is executed. Because of that I think it could be a good idea to get the orderno of the current job from the server database (maybe cmr_ajf table or with a command) and with this orderno build a query, but I don´t know how to do that.

Is possible to get which is the orderno for the current job? or Is there another
way (maybe better) to know which one is the current job and to get all the information you need about it?

Thanks in advance.

Posted: 15 Jan 2008 4:14
by hipikll

Posted: 16 Jan 2008 10:51
by updt1
Thanks hipikll,

the link is useful, but I have the problem that I don´t have a GUI, the only information I can manage is the server database, so I have to find the information about the orderno (or jobno) on it (running a sql query or a Control-M command/utility on my program), so that is what I am looking for, a sql query or a command / utility that could help me.

Thanks.

Posted: 16 Jan 2008 2:33
by hipikll
hm, so when the job A is ordered, you have no information about it - for example from EM GUI or from ctmorder command?
So you know only the job name and nothing more?
I have the DB structure for CM, but I never used direct sql queries.

How about using ctmlog listjobname <job_name> ... (see manual).
From this command you can obtain the orderid and then transfer it to orderno of specified job.

Posted: 23 Apr 2008 4:13
by mauriziog
The orderid of a job?
Use the variables: %%ORDERID is the order id of the current job.
So if for example you have 2 jobs: JOB1 and JOB2 and in the JOB2 you want the orderid of the JOB1 do this:

- In JOB1 var panel:
\%%JOBORDER=%%ORDERID

- In JOB2 use this variable:
echo %%JOBORDER for example.

How to get the orderno?

Posted: 05 Mar 2011 8:09
by parkerkevin73
You can get the database for the server database for a specific jobs and the run the program and submitted before the execution it helps the orderno to server database You can take the order no to built a query.

Posted: 26 Feb 2014 9:04
by anirudhrh
p_36 <orderid>

Re: How to get the orderno?

Posted: 27 Feb 2014 7:05
by sunuriyal
Use control-M Server utility ctmpsm -LISTALL
the first column of information is of orderid. you can further filter your jobs with grep.

Re: How to get the orderno?

Posted: 11 Jun 2015 6:22
by anirudhrh
just login as control-m user on the control-m server and type p_36 <orderid>