Page 1 of 1

running Routines from unix prompt.

Posted: Sat Dec 25, 2004 1:42 am
by dsxdev
Hi
Is there any posibility to execute routines through unix scripts?
If so how can this be achieved ?
When we write routines where does DataStage store these routines and in what form does it store. Can we access this Data Stage Repository?

Posted: Sat Dec 25, 2004 2:54 am
by roy
Hi,
with Server jobs, you can use DSExecute or EexecSH to run OS command lines and getting he return code and output of that command line, hence running a shell script and even getting value/s back is possible.
the question is what does the script do?
could it be done in a DS routine?
if you'll post what the script does people might propose a best practice for it if a better option to acomplish the task exists.

You could use the dsjob command line interface to run ds jobs hence invoking the routine in that mannor.

IHTH,

Posted: Sat Dec 25, 2004 4:53 am
by ogmios
Roy,

I think the question is the other way around, they apparantly want to execute DataStage routines from a UNIX script, not UNIX scripts from DataStage jobs.

Answer would be no. dsxdev, what do you want to execute a DataStage routine for? You can execute DataStage jobs from UNIX with dsjob, but nothing exists for routines, how would you want to execute a routine without established environment, e.g. if you write something to the log in such a routine where should this information be logged in DataStage?

Ogmios

Posted: Sat Dec 25, 2004 2:54 pm
by ray.wurlod
Because Routines have arguments, and because the UNIX shell has no argument-passing mechanism, what you seek to do is not possible.

You would need to create a wrapper program (see my recent post on this), which you can not do using DataStage clients.

Use the right tool for the right job.

For something to be run from the UNIX shell's command line, create a UNIX executable or shell script.

For something to be executed in the dssh shell, use the appropriate mechanism (for example the Test grid for a Routine).

Posted: Sun Dec 26, 2004 12:18 am
by Amos.Rosmarin
Hi,

The wrapper program can be a datastage job.
Write a datastage job that activates your routine and you can execute this job from the dsjobs exe.


HTH,
Amos