How to get the orderno?

Several scripts
Post Reply
updt1

How to get the orderno?

Post by updt1 » 15 Jan 2008 11:42

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.

hipikll

Post by hipikll » 15 Jan 2008 4:14


updt1

Post by updt1 » 16 Jan 2008 10:51

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.

hipikll

Post by hipikll » 16 Jan 2008 2:33

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.

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 23 Apr 2008 4:13

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.

User avatar
parkerkevin73
Nouveau
Nouveau
Posts: 2
Joined: 03 Mar 2011 12:00

How to get the orderno?

Post by parkerkevin73 » 05 Mar 2011 8:09

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.
SEO

User avatar
anirudhrh
Nouveau
Nouveau
Posts: 48
Joined: 21 Sep 2013 12:00

Post by anirudhrh » 26 Feb 2014 9:04

p_36 <orderid>
Anirudh

User avatar
sunuriyal
Nouveau
Nouveau
Posts: 27
Joined: 18 Jan 2014 12:00

Re: How to get the orderno?

Post by sunuriyal » 27 Feb 2014 7:05

Use control-M Server utility ctmpsm -LISTALL
the first column of information is of orderid. you can further filter your jobs with grep.

User avatar
anirudhrh
Nouveau
Nouveau
Posts: 48
Joined: 21 Sep 2013 12:00

Re: How to get the orderno?

Post by anirudhrh » 11 Jun 2015 6:22

just login as control-m user on the control-m server and type p_36 <orderid>
Anirudh

Post Reply