Page 1 of 1

Simple Execute Command Activity

Posted: Tue Aug 08, 2006 11:05 am
by Art Cabugason
How do I launch an .exe or .bat file using the Execute Command Sequence? I have tried launching notepad.exe as a test but the job gets stuck. In the ExecCommand tab of the stage property, I entered C:\WINDOWS\system32\notepad.exe in the Command: field. I left Parameters: blank and 'Do not checkpoint run' checked.

Any ideas?

Thanks!!!

Posted: Tue Aug 08, 2006 11:08 am
by chulett
:!: Pick something that doesn't want to open a window and run in the foreground. Maybe just 'echo' or 'type' something... otherwise you're in the ballpark.

Posted: Tue Aug 08, 2006 2:55 pm
by Art Cabugason
Craig,

Thanks for your response. I tried it but I'm still getting an error. Here's the script that I ran is below:

echo OFF
cd C:\WINDOWS\system32
call notepad.exe

I got the following warning messages:

test_script_run2..JobControl (@Execute_Command_0): Command C:\Documents and Settings\acabugason\Desktop\test.bat did not finish OK, reply = '1'

test_script_run2..JobControl (@Execute_Command_0): Controller problem: Unhandled failure (1) encountered executing command C:\Documents and Settings\acabugason\Desktop\test.bat

Any idea what I did wrong?

Thanks again!

Art

Posted: Tue Aug 08, 2006 3:34 pm
by kris007
Did you try running that .bat file from the command line? Did it open the notepad? Also, try using an exit statement in the .batfile at the end so that the command window doesn't hang in the background. I find that helpful though not sure if that is causing the error.

I don't think you will have to use

Code: Select all

cd C:\WINDOWS\system32
You should be able to call notepad.exe from anywhere on the command line.

Posted: Tue Aug 08, 2006 5:13 pm
by chulett
Why the fascination with notepad? How do you expect your script to edit something and then close out the GUI window?

Test what you are doing with something appropriate for execution in the background - something other than Notepad. As I said, I don't see anything grieviously wrong with what you are doing other than your choice of command to execute.

Posted: Tue Aug 08, 2006 7:39 pm
by Art Cabugason
Ok ... I got over the notepad obsession. I was just doing what the techies asked me to do ... in any case, we tried running a file copy command (copy fileA.txt fileB.txt) and that did not work either. For those who have Ascential licenses bundled with Peoplesoft, could this be a license limitation?

Posted: Tue Aug 08, 2006 8:04 pm
by kcbland
First: DataStage does not run GUI programs, it moves data around. If you want to see it run a OS command, you can start with a simple test. Just try "echo 'hello world". You should be able to read the job log and see the message.

After that, it's up to you to make sure that directory paths are accurate, file exists, etc.

You cannot launch GUI screens because DataStage is a background execution, there is no "user" sitting in front of a console. The processes are executing as tasks inside the Windoze server, in fact, the only way to see them is to use Task Manager and see the processes running. There are no windows for you to see on the Server, in fact, no one has to be logged in on the server.

What is your true problem?

Posted: Tue Aug 08, 2006 8:21 pm
by chulett
Art Cabugason wrote:For those who have Ascential licenses bundled with Peoplesoft, could this be a license limitation?
No. As noted, you need to provide more details. First would be your exact version of DataStage. Also, details about exactly what you are doing and the errors you are getting. Unfortunately, saying "that did not work either" doesn't give us anything to go on.

Help us help you.

Posted: Tue Mar 27, 2007 8:40 am
by jdulaney
Art Cabugason wrote:For those who have Ascential licenses bundled with Peoplesoft, could this be a license limitation?
Nope, I have routines that do commands, especially sqlplus, so I know it is not a license issue.