Executing a DOS command

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
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Executing a DOS command

Post by I_Server_Whale »

Hi All,

I need to execute a DOS batch file. Currently, I'm doing it in a 'Before Job Subroutine', the job here extracts data from ODBC to text file. But I want to execute this batch file as a different job.

How can I include just the batch file in an empty(new) job without anything else? All this job does is execute the batch file.

I tried used 'Execute Command Stage' in sequencer. But it is not executing the DOS command.

I don't know why. Any help is very much appreciated.

Thanks much,

Naveen.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Naveen,
I have used 'Execute Command Stage' in sequencer to execute my .bat file with the job parameters; it is working perfectly for me. What's the error message from your job? Don't just say Command Stage is not working.
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

Use Jobcontrol to call the batch file. The batch file can be executed using DSExecute function.

HTWH.

Regards
Saravanan
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Hi Saravanan,
If you look the code generated for Command Stage, the DSExecute is called to excute the all the information in the .bat file.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi lstsaur,

I'm not getting any error message. The 'Execute Command' stage runs fine. But nothing happens really. I mean the SQL script is not run, which is supposed to, through the batch file.

Should I use the 'Command Stage' instead of the 'Execute Command' Stage? May be I should. I'll try that and let you know.

FYI, the batch gets executed when included in the 'Before JOb Subroutine'.
:?:

I'll get back to you after trying the 'command stage'.

Thanks a lot for your response.

Naveen.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You need to look in the log of the Sequencer job to see what happened with the Execute Command Stage. Usually you need to double-click on it to see all of the gory details. The job won't error when there is a problem running your command... well unless you have triggers to handle that and the command actually reports back errors. :wink:

If 'nothing happens' I would guess that you are not giving the full path of the batch file in the stage and it can't find it to run it. Again, that should be recorded in the log.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The 'Execute Command' stage runs fine. But nothing happens really.
What's wrong with this picture?

Does it run really fast?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply