Page 1 of 1

dsjob syntax error

Posted: Fri Jul 13, 2012 6:33 am
by pavans
Hi All,


/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob -domain $1 -user $2 -password $3 -server $4 -run -paramfile /userdata/Parameters/$7/$5 -jobstatus $7 $8 -- Working Fine

/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob -domain $1 -user $2 -password $3 -server $4 -run -paramfile /userdata/Parameters/$7/$5 -param $runtime -jobstatus $7 $8 -- Not working

The only change in the second command line is -param $runtime, which is passing a date(year and month).

Am I passing -param in the right order in the syntax.
I searched the forum but could not get much information.
any help appreciated.

Thanks in advance.

Posted: Fri Jul 13, 2012 7:08 am
by ArndW
does the year/date contain blanks, i.e. "2010 05 20"?
also, could you post an actual command line and the error message?

Posted: Fri Jul 13, 2012 7:12 am
by chulett
What comes after -param is a "name value pair", so $runtime would have to look something like p_runtime=2012-07-15 to work correctly. Does it?

Posted: Fri Jul 13, 2012 7:25 am
by pavans
ArndW wrote:does the year/date contain blanks, i.e. "2010 05 20"?
also, could you post an actual command line and the error message? ...
$6 = '2012-07-13 07:00' -- This is coming from a JCL.

runtime=`expr substr $6 1 4``expr substr $6 6 2`

I have tested this and the output is 201207

Posted: Fri Jul 13, 2012 7:28 am
by chulett
In other words, incorrect. Please (re)read my post.

Posted: Fri Jul 13, 2012 7:31 am
by pavans
chulett wrote:In other words, incorrect. Please (re)read my post. ...
Ok.
What you mean is that the value for -param $runtime should be '2012-07'?

Posted: Fri Jul 13, 2012 7:41 am
by chulett
No. My post clearly shows it must be the parameter name, an equal sign and then the parameter value. The value should be whatever is appropriate for the parameter.

Posted: Fri Jul 13, 2012 7:53 am
by pavans
my bad. its been a tough week and late on friday. sorry for missing it.

so
-param p_runtime=`expr substr $6 1 4``expr substr $6 6 2` should work?

I will get back to you after testing.

Thanks a lot.

Posted: Fri Jul 13, 2012 8:16 am
by chulett
You'll get a lot closer. :wink:

FYI, the dsjob syntax is fully documented in the Programmer's Guide pdf in the Command Line Interface chapter. For example:
-param specifies a parameter value to pass to the job. The value is in the format name=value, where name is the parameter name, and value is the value to be set. If you use this to pass a value of an environment variable for a job (as you might do for parallel jobs), you need to quote the environment variable and its value, for example -param '$APT_CONFIG_FILE=test.apt' otherwise the current value of the environment variable will be used.

Posted: Mon Jul 16, 2012 6:40 am
by pavans
I got a little closer as you said.
I searched the forum and found that if the parameter is a Date we should enclose it in Single Quotes. I did that. But still I am facing an error saying Invalid Arguments.
Now my -param looks like below:


-param 'p_runtime=`expr substr $6 1 4``expr substr $6 6 2`'
Am I missing something here?

$6 = '2012-07-13 07:00' which is coming from a JCL.

Posted: Mon Jul 16, 2012 6:45 am
by chulett
You must pass in a Date in YYYY-MM-DD format which is why '201207' is invalid. Change the parameter to a String if that is truly what you need to pass to the job.

Posted: Mon Jul 16, 2012 7:17 am
by pavans
Ok. I did below:

runtime=`expr substr $6 1 4``expr substr $6 6 2`

-param "p_runtime=$runtime"

Still It says Invalid args.

Posted: Mon Jul 16, 2012 7:29 am
by chulett
So, you didn't actually change the values you are passing in - did you change the parameter type? Please post the full, unedited error message. Also, remove the quotes.

Posted: Mon Jul 16, 2012 8:21 am
by pavans
chulett wrote:So, you didn't actually change the values you are passing in - did you change the parameter type? Please post the full, unedited error message. Also, remove the quotes. ...
I am running a JCL which has a Unix Script.

Here what I tried now :

/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob -domain $1 -user $2 -password $3 -server $4 -run -paramfile /userdata/Parameters/$7/$5 -jobstatus $7 $8 -param p_runtime="201207"

Tried below as well
-param p_runtime=201207

Job successfully runs when I remove -param from the above command line.

Below is the error.

Run XXXXX JobName
Invalid arguments: dsjob -run
....-mode <NORMAL . RESET . VALIDATE>.
....-paramfile <filename>.
....-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
Job Return Code: 255
/opt/IBM/InformationServer/Server/DSEngine/bin/dsjob -jobinfo ProjName Jobname
ERROR: Couldn"t open the project XXXXX, will try to access the project again
i = 1
Reset XXXXX JobName
Error running job

Status code = -2 DSJE_BADSTATE
Run XXXXX JobName
Invalid arguments: dsjob -run

Posted: Mon Jul 16, 2012 8:59 am
by pavans
Oh my goodness..

I changed the order of -param and -jobstatus and job is running now.
When I searched the forum most of the dsjob syntax had -jobstatus first and then the -param, so I used the same syntax.

Currently I hardcoded the -param value. Let me try with with a variable and get back to you.