dsjob syntax error

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

dsjob syntax error

Post 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.
Thanks,
Pavan
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words, incorrect. Please (re)read my post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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'?
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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.
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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.
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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.
Thanks,
Pavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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
Thanks,
Pavan
pavans
Participant
Posts: 116
Joined: Sun Sep 10, 2006 7:33 am
Location: bangalore, india

Post 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.
Thanks,
Pavan
Post Reply