Page 1 of 1

Running DataStage jobs with Control M

Posted: Sun Dec 21, 2003 5:00 pm
by Viswanath
Hi All,

I know this is xmas and people are on holidays. But if there is anybody who could help me out it would be great.

I am using Control M to run DS jobs. The DS jobs are called from command files (Windows). We have given the slwwp time for these jobs as 10 seconds. It is strange but sometimes even though the DS jobs run fine, the Control M jobs fail. Thus the rest of the jobs do not run.

Is the sleep time of 10 seconds ok? Do we need to increase or decrease this? Has nyone else faced a similar problem? The return code that is sent to the command file is also ok. So ideally there should have not been a problem.

Merry Christmas and a Happy new year to all.

Cheers,
Viswanath

Posted: Sun Dec 21, 2003 5:03 pm
by kcbland
How are you starting the jobs using dsjob? Are you using the -wait option? If you don't use -wait, dsjob will start a job and not wait for it to finish.

Please see this post

viewtopic.php?t=85578

for an example script of the checking you would have to do to insure that your job is properly started, executed, and then the appropriate return code is passed back to Control-M for the status of the job.

Posted: Sun Dec 21, 2003 9:07 pm
by ray.wurlod
Just to add my $0.02 worth, both the BASIC function DSRunJob and the default operation of dsjob are "asynchronous" operations. All they do is submit a request to the server for job execution. Then they're done. You have to make your own arrangements for detection job completion, and any other job characteristics in which you're interested. And, yes, it was designed that way.

Posted: Mon Dec 22, 2003 8:17 am
by sachinc
Hi,

Please check the control-M. I have used the control-M schedular, in which any return code except 0, was treated as an error code.

The dsjob returns values like 1 or 2 -- for execution with warnings, even after successful execution of the job. For dsjob to start a job and wait for it to finish, certain options needs to be mentioned. Please refer the developer guide for more details.

Regards,
Sach.

Posted: Mon Dec 22, 2003 10:11 am
by Teej
Also do a search for my posts about dsjob. I discussed about it quite often on this forum, with a number of gotchas that have to be dealt with, along with a mysterious error message that I still have not resolved.

There be gold in thar hills!

-T.J.

Posted: Mon Dec 22, 2003 10:32 am
by shawn_ramsey
Yes, Control-M by default treats any exit code besides 0 as an error. There are options in Control-M where you can define what exit codes are treated as errors.

Shell script to run DataStage Jobs with Control-M

Posted: Fri Jun 01, 2012 4:33 am
by andreportugal
You can check my solution for that in my web page, here:

https://sites.google.com/site/andremaur ... ntegration

My solution has this strenghts:
Doesn't use the dsjob with the -wait option, so you can still limit session timeout on Administrator. This script lauches the Job in background and then checks periodicaly if the Job status has changed. When it changes, it reports that to Control-M using the correct return codes.
Because it launches the DataStage Jobs in background, it is not as vulnerable to network problems as common approaches if the Control-M Agent and DataStage Server are in different machines.
It can reset the Job if required.
If the Job aborts, it will get the error message and communicates it to Control-M in the stdout.
Can be executed in a machine other than DataStage Server's (just configure shared keys and it will use ssh to make the Job invocations).
It is versatile. You only need one shell-script per DataStage Project. The parametrization is done on Control-M side and only have to put the Job name and Job parameters. All the other details will be inside this shell-script (Websphere App Server hostname, DataStage Server Engine hostname, Project name, username and password). Common approaches involve one script per job invocation, wich is more time consuming to develop, maintain and manage.

Posted: Fri Jun 01, 2012 6:05 am
by chulett
Holy thread necromancy, Batman! I think you win the prise for bringing the oldest thread back to life - pushing 9 years. :wink:

One suggestion, if you are going to open this up to the world I would suggest in the section where you say "don't change anything below" that you change your comments and messaging from Portuguese to English. That would help make it more... adoptable... by people out there. IMHO.