dsjob Win batch file

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
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

dsjob Win batch file

Post by chrisk »

Hi,

I'm looking for a sample Windows batch file for executing dsjob. I have created UNIX versions in the past but would love to be able to leverage someone else's windows scripting talents!

I have searched high and wide through dsxchange and Ascential DEVNET but alas...

Any help much appreciated.

Ta,
C.
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It should be exactly the same, except that:
  • command line arguments are accessed as %1, %2 and so on

    variables, including environment variables, are accessed as %varname%

    there is no such thing as a "here script"
The last of these ought not to be a problem for a dsjob BAT file.
Take a look at the BAT file generated when a job is scheduled from Director; this will give you more good ideas. Get to a DOS prompt and type AT to get a list of what's scheduled; the list includes the pathname of the BAT file in question.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

Thanks Ray.

My "at" listing of a scheduled job on my DataStage server (DS7.1 Win) provides the following command line:

vmdsr_sched.exe u:\datastage\projects\dwprd MPARK_Master_Sequence /50 1

where MPARK_Master_Sequence is my scheduled job name.

Perhaps DS does not execute the job via a BAT file anymore?

Anyway, if anyone is in a caring and sharing mood :D and would like to email me a copy of their dsjob BAT file, my email is chrisk@altis.com.au.

Much appreciated.

Ta,
C.
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

I think Ken Bland or Craig Hulett posted a really cool one. Ken definitely posted a cool UNIX shell script.
Mamu Kim
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

I was able to find Ken's UNIX script but alas, no Win scripts...
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Try searching ADN.
Mamu Kim
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

I did (see my first post).
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

Here's a sample Win batch file I have created to call dsjob. Hopefully this might inspire others who have far superior ones to share them!

======================================
rem Set params
set vSERVER=%1
set vUSER=%2
set vPASSWORD=%3
set vDS_PROJ_NAME=%4
set vDS_JOB_NAME=%5
set vPARAMS=%6


rem Change dir to the DataStage server bin dir
d:
cd D:\Ascential\DataStage\Engine\bin

rem Execute dsjob.
dsjob -server %vSERVER% -user %vUSER% -password %vPASSWORD% -run %vPARAMS% %vDS_PROJ_NAME% %vDS_JOB_NAME%
======================================

A sample command line to execute this simple batch file would be:

run_dsjob.bat <server> <user> <pwd> <DS proj name> <DS job name> <"-param param1=value1 -param param2=value2...">

The trick to be aware of is that you need the batch file to be able to handle calling DS jobs with a variable number of params. Hence I pass all the DS job params as a single param to the script.

I'm sure there are better ways to do this in Win and I look forward to contributions! :wink:

Ta,
C.
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You might be inspired by a BAT file for finding the DS Engine directory on Windows. 8)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

Nice, but would this come under the heading of "use with caution as Ascential may change how they do this"?

C.
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Mamu Kim
chrisk
Participant
Posts: 37
Joined: Wed Feb 26, 2003 6:20 pm

Post by chrisk »

Thanks. :-)
Chris Kearns
Altis Consulting Pty Ltd
www.altis.com.au
Post Reply