Running DataStage jobs with Control M

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Viswanath
Participant
Posts: 68
Joined: Tue Jul 08, 2003 10:46 pm

Running DataStage jobs with Control M

Post 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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sachinc
Participant
Posts: 3
Joined: Thu Dec 04, 2003 5:03 am

Post 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.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post 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.
Developer of DataStage Parallel Engine (Orchestrate).
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post 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.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
andreportugal
Participant
Posts: 5
Joined: Tue May 08, 2007 7:10 am
Location: Portugal

Shell script to run DataStage Jobs with Control-M

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply