Page 1 of 2

Passing Multiple parameters to dsjob returns DSJE_DSJOB_ERRO

Posted: Wed Jan 21, 2009 12:56 pm
by vish08
When multiple parameters, in this case FromDate and ToDate, returns error.
$ dsjob -run -mode NORMAL -jobstatus -parm FrDate=80909 ToDate=80910 SALES TestSales

Invalid arguments: dsjob -run
[-mode <NORMAL | RESET | VALIDATE>]
[-param <name>=<value>]
[-warn <n>]
[-rows <n>]
[-wait]
[-opmetadata <TRUE | FALSE>]
[-disableprjhandler]
[-disablejobhandler]
[-jobstatus]
[-userstatus]
[-local]
[-useid]
<project> <job|jobid>

Status code = -9999 DSJE_DSJOB_ERROR

Posted: Wed Jan 21, 2009 1:40 pm
by DSguru2B
I believe you need to have -param before each parameter. And its 'param' and not 'parm'.

Posted: Wed Jan 21, 2009 1:47 pm
by vish08
Thank you. I tried
$ dsjob -run -mode NORMAL -wait -jobstatus -param 'FromDate=80909' -param 'ToDate=80910' ADW_SALES TestSalesDetailFixEE
but returns
Error running job

Status code = -99 DSJE_REPERROR

Posted: Wed Jan 21, 2009 2:11 pm
by jseclen
Hi vish08

Your command is incorrect, the sintax is:

$ dsjob -run -mode NORMAL -wait -jobstatus -param FromDate='80909'
-param ToDate='80910' ADW_SALES TestSalesDetailFixEE

Try with this correction.


:wink: :D

Posted: Wed Jan 21, 2009 2:39 pm
by lstsaur
It should be coded as -parm FrDate=80909 -parm ToDate=80910.

Posted: Wed Jan 21, 2009 2:40 pm
by vish08
Still the same error

Posted: Wed Jan 21, 2009 2:43 pm
by lstsaur
Correction. It should be -param.

Posted: Wed Jan 21, 2009 2:50 pm
by vish08
Sorry. Still the same even without quotes.

Posted: Wed Jan 21, 2009 3:06 pm
by chulett
Assuming your job is in a runnable state - compiled and not already running - try adding the authentication parameters to the command line: -server, -user and -password.

Posted: Wed Jan 21, 2009 10:44 pm
by kduke
Your syntax looks correct. A 99 usually means job is not in a runnable state.

Posted: Thu Jan 22, 2009 3:24 pm
by vish08
Thank you Craig. I as Developer can not dsjob from command line. Developer nned to have dsadm role. May be this is in v8.0.

Posted: Thu Jan 22, 2009 3:46 pm
by ray.wurlod
Rot. A member of the Developer role for DataStage (provided all other permissions and credentials are in place) can legitimately use dsjob command. What error message do you get?

Posted: Thu Jan 22, 2009 9:03 pm
by vish08
I am getting, "Error running job

Status code = -99 DSJE_REPERROR"

I checked in Director. Job is in compiled state. I can run job from Director. But trying to run the same job from command line giving me error.

Posted: Thu Jan 22, 2009 10:12 pm
by chulett
Did you try what I suggested? :?

Posted: Fri Jan 23, 2009 9:12 am
by vish08
It did the majic. Thank you craig.

$dsjob -server ServerName:portnumber -user User.Name -password **** -run -mode NORMAL -wait -jobstatus -param FromDate=80909 -param ToDate=80910 ProjectName JobName

returns
Waiting for job...
Finished waiting for job
Job Status : (2)

Status code = 2

Job has some warnings. Next step is read parameters from a file. File structure is
FromDate ToDate
80101 80129
80130 80228
80301 80331
etc..