DS job calling shell script

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
sweetleaf
Participant
Posts: 30
Joined: Fri Jan 24, 2003 3:28 pm
Location: Canada

DS job calling shell script

Post by sweetleaf »

Hi there,

I have a DS job which calls a .ksh script (in the after -job sub-routine section of the jobs property sheet).

The shell script resides on the same unix server as DS (box1).
The shell script calls an oracle stored procedure (SP1) residing on another unix server (box2).

SP1, in turn, calls SP2 then SP3.

The problem I'm having is that SP1 executes only SP2 and NOT SP3!
Has anyone ever had this type of issue with DS?

When I run SP1 directly from box2 (without DS), it works fine and both SP2 and SP3 get called (I check some tables to see if processing has indeed occured).

Any help would be greatly appreciated!
Thank You
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The best advise for shell scripts is - do not assume *anything* about the environment. Just because it runs outside of DataStage is no guarantee it will run inside DataStage, even when run under the "same user". The environment the job runs in is not what you expect.

Things to check: specify korn in the header of the script (#!/bin/ksh), use full paths, etc. Assume Nothing.

Also, an interesting experiment is to execute a script that does nothing other than dump the jobs' environment and then check out the results. Very enlightening. [:D]

-craig
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It might also be interesting to see whether the same behaviour of the shell script occurs outside DataStage but on box 1. Is SP3 executed in this case?
I can't imagine, if the calls to SP2 and SP3 are in SP1, why the script itself would have any impact. It's got to be something about the environments. Craig's post has covered that fairly well. Check that box 1 sets everything you need. Also, is any message generated by SP1 that indicates that SP3 could not be invoked?


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply