Return code for fatal warnings ?

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Return code for fatal warnings ?

Post by kaps »

Let me first explain our setup. DataStage jobs are executed by Third party scheduler tool using shell scripts. Shell script is set up in a way it returns non zero value when the job does not finish successfully which fails the scheduler job.

I would like to know if there is anyway to catch the fatal warnings by return code but not some informational warnings. For example, I don't want to fail the job when I get "add_to_heap() - Unable to allocate memory" when preload to cache is enabled. At the same time I don't want to neglect the data truncation warnings. Problem is both warnings return same return code.

We use one common shell script to execute all the jobs. so we can't add all these warning checkings inside the script. Is there anyway I can check for particular warning inside DataStage job ?

Please let me know if you guys deal this in different way...


Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What dsjob options are you using in your script? If you use "-jobstatus" you'll be able to tell the same level of detail you'd see from the Status View of the Director - Finished OK, Finished OK (see log), Aborted, etc. If you need to distinguish between different non-fatal warnings, then this approach won't work and you'll need to add some additional processing to your script to interrogate the job's log. Check the help for the various "-log" options available.

Personally, I don't allow a Server job to ever return any warnings of any kind, so we use the above noted "-jobstatus" option and fail the job if it returns anything other than a '1'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Post by asitagrawal »

I agree with Chulett on "interrogating the logs".. and hence I would try to achieve this by using a After stage routine, to generate the job report or say colelcting all the messages other than Information messages and then search for some key words e.g "Row Truncation" or "allocate heap" etc.
If found , I will take necessary actions required.

Hope this helps.
Share to Learn, and Learn to Share.
Post Reply