Page 1 of 1

DOS Bat File to DataStage Job

Posted: Mon May 01, 2006 12:46 pm
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

Posted: Mon May 01, 2006 12:49 pm
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.

Posted: Mon May 01, 2006 12:51 pm
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.

Posted: Mon May 01, 2006 1:04 pm
by Bryceson
Craig,

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

Bryceson

Posted: Mon May 01, 2006 2:52 pm
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,