DOS Bat File to DataStage Job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Bryceson
Charter Member
Charter Member
Posts: 88
Joined: Wed Aug 03, 2005 1:11 pm
Location: Madison, WI

DOS Bat File to DataStage Job

Post by Bryceson »

Hi All,

Created dos bat file run DataStage job:

@echo off
SET DsJob=E:\Ascential\DataStage\Engine\bin\dsjob.exe
Dsjob -run -mode NORMAL PLQ StateCodeHash

Error message:
D:\TEMP>DWTEST.bat
'Dsjob' is not recognized as an internal or external command,
operable program or batch file.


BUT if I run from dos command line:

E:\Ascential\DataStage\Engine\bin\dsjob -run -mode NORMAL PLQ StateCodeHash

It works - run the job fine!!

Any ideas will be appreciated.

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

Post by chulett »

Well... in one you fully path the command (which works) and the other you have a relative path (which doesn't work). So, either change your batch file to use a full path to dsjob or make sure the Engine/bin directory is in your path.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I missed the 'SET' command... is there something special you need in order for 'Dsjob' to be recognized?

Or just skip the SET and use the full path to the .exe.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Bryceson
Charter Member
Charter Member
Posts: 88
Joined: Wed Aug 03, 2005 1:11 pm
Location: Madison, WI

Post by Bryceson »

Craig,

Thanks . . . . Got it to work without the SET command!!

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

Post by roy »

Hi,
Your problem is that after you define the variable you must address it enclosed with % signs, much like DS job parameters in some cases.
so in your case:

Code: Select all

@echo off 
SET DsJob=E:\Ascential\DataStage\Engine\bin\dsjob.exe 
%DsJob% -run -mode NORMAL PLQ StateCodeHash
should work.

By the way writing any lower/capital version of the DsJob variable is the same since unlike DS batch scripts are not cases sensitive.

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
Post Reply