Page 1 of 1

Call .exe file thru DataStage

Posted: Tue May 09, 2006 1:56 pm
by rajeevs
Hello All:

Could somebody help us call a .exe file through DataStage Server on Windows. The .exe file was created through VB and i need to run the .exe first and then kick-off the DataStage server job.

I tried to call them using the Execute Command stage through Sequencer - but could not do so. I also tried to call the .exe thru a batch file and call the .bat file thru a before-job subroutine, but could not do it either..
Below is the log:
*******************************
*** Output from command was: ***
'xxx.bat' is not recognized as an internal or external command,
operable program or batch file.
*******************************

Any help would be appreciated !!

-Raj

Posted: Tue May 09, 2006 2:02 pm
by chulett
Fully path the bat file.

Posted: Tue May 09, 2006 2:15 pm
by kcbland
CWD is always the project. It's dangerous to not fully qualify all scripts and paths.

Posted: Tue May 09, 2006 2:29 pm
by rajeevs
The entire path for the .bat file was already given.. I editied out the log in my previous message..

-Raj

Posted: Tue May 09, 2006 2:39 pm
by kcbland
Not to insult your intelligence, but the job runs on the server, therefore the paths must be local to the server. Any chance you're trying to run a file on your PC and not on the server?

Posted: Tue May 09, 2006 3:46 pm
by rajeevs
Yep, the path was pointing to the server and not to my Local folders :)

Posted: Tue May 09, 2006 4:05 pm
by kcbland
Then the path (which you have not shared) must be the problem. From your Batch job, use the DSLogInfo to log the command you are trying to execute. Maybe even do a "dir" command with DSExecute first on the file to see if the path resolves to the physical .bat file. Log the screen output from the dir command to see what DataStage "sees".

Posted: Wed May 10, 2006 9:46 am
by rajeevs
Ken:

The DataStage job is calling the .bat file but it looks like the job is running for ever. It doesn't stop.

I tried running the .exe file directly from the server. It runs sucessfully in the server. Is there something that i am missing before calling the .exe file thru DataStage. Kindly advise!!

-Raj

Posted: Wed May 10, 2006 9:53 am
by kcbland
I suggest putting some "mile marker" actions into the bat script, such as creating a file right before running the exe to see if the your bat script even gets to that point.

DS can run any command line program as long as that program doesn't attempt any GUI i/o or such. If the program has those activities, you will hang the job. The only way to kill it is to go onto the server and kill the process in Task Manager. Hopefully, the job will free itself up.

Posted: Wed May 10, 2006 12:57 pm
by kduke
If you created your exe with a GUI screen then it maybe locking up waiting for input. These exe files do not like to run in the background.

Posted: Wed May 10, 2006 3:06 pm
by ray.wurlod
Try using the DOS start command to execute your BAT file. This starts a separate window to run the command.