Calling a DS Job From Command Line

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
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Calling a DS Job From Command Line

Post by JDionne »

I need to write a dos batch file to call a DS job where in the documentation should I look for that code and an example of it?
Jim
Sure I need help....But who dosent?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Server Job Develper's Guide, DataStage Development Kit (Job Control Interface), Command Line Interface.

dsjob specifically. :)
-craig

"You can never have too many knives" -- Logan Nine Fingers
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Post by JDionne »

Thanx the documentation is so masive its daunting at times
Jim
Sure I need help....But who dosent?
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Post by JDionne »

There are no examples of this and its terably confusing to me,
is it:

dsjob -run -mode[reset] -warn 50 Development Load456msg
?
Jim
Sure I need help....But who dosent?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Technically, its:

dsjob -server ServerName -user UserName -password Password -run -mode NORMAL ProjectName JobName

You need to supply the values in italics. Being on Windows, you may be able to leave off the userid and password and have it use your current one, I'm not sure. NORMAL is assumed if no mode is passed, or you can RESET or VALIDATE a job instead of running it.

Note that this assumes no Job Parameters are being passed in. To do that, add as many 'name=value' pairs as you need, using "-param ParameterName=Value" syntax for each one. Insert these in the command line before your ProjectName and JobName. You can also slide in a "-warn" and a "-rows" if you like, much like in your example.

You can also add in one of the following - "-wait", "-jobstatus" or "-userstatus" to have the command wait for the job to finish before moving on and to pass back an exit status to the caller. Check the docs for the differences between the three.
Last edited by chulett on Tue Feb 10, 2004 8:51 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Post by JDionne »

when im at a dos prompt, how do I call this? when i put in dsjob even when im in the ascential\datastage\engin folder dos tells me its not a recognized command
Jim
Sure I need help....But who dosent?
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

You have to run this on your server machine.

If your DataStage server is a Windows box, you need to include the Ascential paths (do a search for dsjob.exe and include that in the paths).

-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Post by JDionne »

ya thats where i was on my server in the ascential\datastage\engine dir and i typed in dsjob.exe and it told me that it wasnt a good command. Ill try again in the morning.
Jim
Sure I need help....But who dosent?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

JDionne wrote:ya thats where i was on my server in the ascential\datastage\engine dir and i typed in dsjob.exe and it told me that it wasnt a good command.
On the UNIX side, it lives under the Engine in the "bin" directory... I'm guessing it's the same for Windows.
-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 »

Typing in partial dsjob commands yields syntax (usage) summaries.

For example (once the DS Engine bin directory is in your PATH), try:

Code: Select all

dsjob

dsjob -run

dsjob -logsum
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
praj
Participant
Posts: 14
Joined: Sat Dec 20, 2003 12:46 am

Post by praj »

Once u r in bin dir under DSEngine use the command
dsjob -run -param <parameters list> -jobstatus <project name> <Jobname>

Regards,
Praj
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Just wanted to point out that you can do this on any pc even with no DS client installed, as long as you put the dsjob.exe and several dll's on that pc and it work's like a charm (especially for 3rd party usage - if you don't write a dll of your own for 3rd party applications, be it a regular C/C++ dll or a com dll)

if you still have problems tell us.

IHTH
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Post by JDionne »

OK I found the dsjob.exe file right were you guys said it would be. I have taken the sample code from this post and it errored out saying it didnt understand the switches. This is what my code looks like
dsjob -server scrbbususcnc04 -user webi -password 29DmJj13 -mode NORMAL Development Load456msg

isnt there suposed to be a -run in this some were?
Jim
Sure I need help....But who dosent?
JDionne
Participant
Posts: 342
Joined: Wed Aug 27, 2003 1:06 pm

Post by JDionne »

found it
dsjob -server scrbbususcnc04 -user webi -password 29DmJj13 -run -mode NORMAL Development Load456msg

thanx guys
Jim
Sure I need help....But who dosent?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, that was my fault. I left it out of my original post, I'll go back and correct it in case anybody else stumbles across it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply