Page 1 of 1

Invoke batch file

Posted: Tue Jan 11, 2005 3:06 pm
by dsrules
Hi,
I need to invoke a batch file and read the status code. I read the manual , it says about
DSExecute(ShellType, Command, Output, SystemReturnCode)
Also there is an option for creating a Batch Job in Director or in Sequencer. I want to know how do we specify the file name and path of the batch file and read the status code and depending on the status code we run the next job or abort by writing into log file.
Also how we invoke a utility exe file from Ascential.
Thanks
Mack

Posted: Tue Jan 11, 2005 4:04 pm
by ray.wurlod
DSExecute is what you need - it is a subroutine that you must call from your own DataStage routines. The fourth argument captures the exit status of the BAT file.

The "Batch" that you create in Director is NOT a Windows BAT file; instead it is a batch of DataStage jobs to be executed one after another; it ends up as a job control routine.

You can invoke a utility exe file from DataStage using DSExecute. You can also invoke them using the ExecDOS before/after subroutine. Beware, however, that in the latter case an exit status of other than zero will cause your job to abort.

Posted: Tue Jan 11, 2005 4:10 pm
by dsrules
Hi Ray,
I wanted to know how do we specify the path name for the batch file , I know the shell value would be 'NT', what would be the command value if I have a XXX.bat file to run. Can you please elaborate.
Thanks
Mack

Posted: Tue Jan 11, 2005 8:32 pm
by ray.wurlod
The command is the same as you would use in a CMD shell - the full pathname if the BAT file's parent directory is not in your PATH, or just the BAT file name if it is.