Page 1 of 1

dsjob Command with "-wait" option

Posted: Tue Jan 03, 2017 11:29 pm
by Apy
I am calling dsjob command with"-wait" option from a shell script but it seems, the dsjob command just triggers the job and does not wait for the Job to finish.
Below is the Syntax I am using within the shell -

Code: Select all

DSCMD=/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob

$DSCMD -run -wait -param <Parameters> <ProjectName> <Jobname>
Script triggers the Job and leaves a warning message for the -wait option.
Below is message from the Shell output -

Code: Select all

./ScriptName.ksh: line 52: Waiting: command not found
line 52 is the line number where this dsjob command is written.

Additional Info - I have checked in $DSHOME/bin path using the command dsjob -h and it doesn't show -wait option there but when I try this by writting an incomplete command like dsjob -run, it shows the dsjob syntax which includes -wait option.

Posted: Wed Jan 04, 2017 1:05 am
by chulett

Code: Select all

$DSCMD -run -mode NORMAL -wait -param <Parameters> <ProjectName> <Jobname>

Posted: Wed Jan 04, 2017 1:32 am
by Apy
I have already tried this option. It returns with same warning message.
Also, -mode NORMAL is optional to write, if we don't write -mode then dsjob will run in NORMAL mode as a default behavior.

Posted: Wed Jan 04, 2017 7:54 am
by chulett
Right, always good to fully specify what you want and see if it changes the behavior. It would seem you have found a bug, in your shoes I would contact your official support provider.

Posted: Wed Jan 04, 2017 9:23 am
by qt_ky
I would guess your script has a typo. Can you post the whole script?

Posted: Wed Jan 04, 2017 5:30 pm
by JRodriguez
I guess that the script is not sourcing the dsenv file properly or the dsjob command is not fully qualified.

Test if the command runs fine from $DSHOME/bin after sourcing the dsenv file...If it works then check that part of on your script

We issue the command with same syntax in our shell script and it works like a charm... We only pass MODE if the DS job must be reset

Posted: Wed Jan 04, 2017 11:25 pm
by Apy
qt_ky wrote:I would guess your script has a typo. Can you post the whole script?
So,the guess is correct...Below is the script I was using-
DSCMD=/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob

Code: Select all

If [[<expression>]];
then
`$DSCMD -run -wait -param <Parameters> <ProjectName> <Jobname>`
fi
I just removed "`" from the command and it goes well without any issue with -wait. But still confused, why only -wait was not working? :?

Even the above code was working in earlier AIX version with "`".