Page 1 of 1

Unix scripts from Datastage job

Posted: Fri Sep 15, 2006 12:31 pm
by psriva
Is there any way we can execute a UNIX script from a Datastage job ?

Posted: Fri Sep 15, 2006 12:35 pm
by kris007
Are you on Windows or Unix?

Re: Unix scripts from Datastage job

Posted: Fri Sep 15, 2006 12:36 pm
by meena
Hi

Yes,Execute command activity in the sequencer.
Is there any way we can execute a UNIX script from a Datastage job ?

Posted: Fri Sep 15, 2006 12:38 pm
by psriva
I am on the grid. (Not windows.)

Posted: Fri Sep 15, 2006 12:45 pm
by jatayl
psriva wrote:I am on the grid. (Not windows.)
You can either use an Execute Command in the Job Sequence, or you can go into your job parameters, and execute the unix script either as a pre- or post-command.

TAZ

Posted: Fri Sep 15, 2006 5:19 pm
by ray.wurlod
(1) Before/after subroutine in job
(2) Call DSExecute() subroutine with "SH" as Arg1
(3) Execute Command activity in job sequence

(There are other ways, but these are the most commonly used.)

Posted: Fri Sep 15, 2006 7:27 pm
by kumar_s
Ray - Iam curious to know the rest. I guess Filter option will be one among it.

Posted: Sat Sep 16, 2006 8:14 am
by psriva
Hi Ray,

Thank for the answers. But DSExecute says that the "Command option" (withing the DSExecute) should not prompt for an input (like below).
_____________________________________________________________
Call DSExecute(ShellType, Command, Output, SystemReturnCode)

ShellType (input) specifies the type of command you want to execute and is either "NT" or "UV" (for DataStage Engine)).

Command (input) is the command to execute. Command should not prompt for input when it is executed.
-------------------------------------------------------------------------------------

And I need to execute a UNIX script from within a Datastage job. So do you think I can do this with the DSExecute or should I use some other command.

Posted: Sat Sep 16, 2006 8:58 am
by DSguru2B
Shell type will be 'UNIX'
Command will be the fully qualified path of your script within quotes.

Posted: Sat Sep 16, 2006 3:06 pm
by ray.wurlod
It's correct that scripts can not prompt for input when invoked from DataStage (by whatever method). This is because DataStage processes are background processes.

Nowhere in this thread has any requirement to prompt for input been mentioned. Therefore all answers given have been valid.

Do you REALLY want to invoke an interactive script in a non-interactive environment? Why? If so, make a "here script" that can supply the inputs.

If you had provided some kind of insight as to what you want to do, maybe more exact answers could have been given.

It was not necessary to send a Private Message as well.