Page 1 of 1

Calling a DS Job From Command Line

Posted: Mon Feb 09, 2004 2:54 pm
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

Posted: Mon Feb 09, 2004 2:59 pm
by chulett
Server Job Develper's Guide, DataStage Development Kit (Job Control Interface), Command Line Interface.

dsjob specifically. :)

Posted: Mon Feb 09, 2004 3:02 pm
by JDionne
Thanx the documentation is so masive its daunting at times
Jim

Posted: Mon Feb 09, 2004 3:17 pm
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

Posted: Mon Feb 09, 2004 4:02 pm
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.

Posted: Mon Feb 09, 2004 4:12 pm
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

Posted: Mon Feb 09, 2004 4:18 pm
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.

Posted: Mon Feb 09, 2004 4:26 pm
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

Posted: Mon Feb 09, 2004 4:28 pm
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.

Posted: Mon Feb 09, 2004 7:52 pm
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

Posted: Mon Feb 09, 2004 10:52 pm
by praj
Once u r in bin dir under DSEngine use the command
dsjob -run -param <parameters list> -jobstatus <project name> <Jobname>

Regards,
Praj

Posted: Tue Feb 10, 2004 3:22 am
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

Posted: Tue Feb 10, 2004 8:17 am
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

Posted: Tue Feb 10, 2004 8:20 am
by JDionne
found it
dsjob -server scrbbususcnc04 -user webi -password 29DmJj13 -run -mode NORMAL Development Load456msg

thanx guys
Jim

Posted: Tue Feb 10, 2004 8:51 am
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.