dsjob Win batch file
Moderators: chulett, rschirm, roy
dsjob Win batch file
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.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It should be exactly the same, except that:
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.
- 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"
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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.
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.
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!
Ta,
C.
======================================
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 :wink:](./images/smilies/icon_wink.gif)
Ta,
C.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You might be inspired by a BAT file for finding the DS Engine directory on Windows. ![Cool 8)](./images/smilies/icon_cool.gif)
![Cool 8)](./images/smilies/icon_cool.gif)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.