Simple Execute Command Activity

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Art Cabugason
Participant
Posts: 3
Joined: Thu Aug 03, 2006 5:51 pm

Simple Execute Command Activity

Post 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!!!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Art Cabugason
Participant
Posts: 3
Joined: Thu Aug 03, 2006 5:51 pm

Post 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
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post 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.
Kris

Where's the "Any" key?-Homer Simpson
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Art Cabugason
Participant
Posts: 3
Joined: Thu Aug 03, 2006 5:51 pm

Post 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?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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?
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jdulaney
Charter Member
Charter Member
Posts: 13
Joined: Thu Feb 02, 2006 1:32 pm

Post 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.
Post Reply