Page 1 of 2

Executing dsjob command from routine activity

Posted: Wed Jul 06, 2011 5:17 am
by samyamkrishna
Hi,

I am triggering a job from sequence using a routine activity.

inside the routine activity i am use ExecSH.

and passing teh dsjob command as input argument.

the job runs and teh jobs log is also fine, but the log of the sequence says.

JobControl (ExecSH): Error when executing command: dsjob -run -jobstatus -param SRCSYSTEM PROJ JOBNAME.

Output from command was: ***
who: 0551-012 The process is not attached to a terminal.
Do not run who am i as a background process.

what am i doing wrong.

Regards,
Samyam

Re: Executing dsjob command from routine activity

Posted: Wed Jul 06, 2011 6:29 am
by chulett
samyamkrishna wrote:what am i doing wrong?
Running a job using ExecSH from a routine activity stage. Any particular reason you can't use the Job Activity stage?

Re: Executing dsjob command from routine activity

Posted: Wed Jul 06, 2011 6:47 am
by samyamkrishna
The job names ( the invocation id ) and parameters are decided at run time.

Posted: Wed Jul 06, 2011 6:52 am
by chulett
Invocation IDs (which can be parameterized) and other job parameters "decided at runtime" are easily accomodated in the Job Activity stage. IMHO, you'd be best served by going that route.

If you really want to go the ExecSH route, post the routine code.

Posted: Wed Jul 06, 2011 6:57 am
by samyamkrishna
Hi craig,

Its the built in ExecSH routine.

the argumet is "dsjob -run PROJ JOBNAME"

Posted: Wed Jul 06, 2011 7:11 am
by chulett
So, there's no routine code involved and all the stage does is call ExecSH? Use the Execute Command stage instead, run dsjob from there if that's all you are doing.

Posted: Wed Jul 06, 2011 7:24 am
by samyamkrishna
alright craig. will discuss with the team and give you an update.

But i am just curious to why that error is coming.

Posted: Wed Jul 06, 2011 7:28 am
by PhilHibbs
Do you need to specify -wait in the dsjob command?

Posted: Wed Jul 06, 2011 7:33 am
by chulett
The first post shows them using "-jobstatus".

As to the why of the error, you'd probably need to go to support for that since we're not privy to the inner workings. But to me it stems from improper use of the Routine Activity stage with ExecSH, I would think it would be fine if you wrote an actual routine and then inside that routine called ExecSH.

Posted: Wed Jul 06, 2011 7:57 am
by chulett
I'm going to repeat something - if all you are determining dynamically is the Invocation ID then there's no reason to not use a Job Activity stage for this. However, if you are actually deciding on the job name as well at runtime, then this approach is appropriate.

Posted: Wed Jul 06, 2011 8:01 am
by samyamkrishna
PhilHibbs wrote:Do you need to specify -wait in the dsjob command?
Hi,

Yes we are using wait and a lot of other parameters as well. I have just given a sample.

Posted: Wed Jul 06, 2011 12:01 pm
by samyamkrishna
chulett wrote:Outside of a dog a book is man's best friend
Inside of a dog it's too dark to read
super funny

Posted: Wed Jul 06, 2011 1:38 pm
by chulett
Groucho Marx. :wink:

Posted: Wed Jul 06, 2011 11:10 pm
by samyamkrishna
Hi,


I am also passing the job name at the run time.
But have not yet discussed about using the execute command activity instead of routine activity.

Hope fully will finalize on that today.


Thanks,
Samyam

Posted: Thu Jul 07, 2011 3:58 am
by samyamkrishna
we are going with Execute command activity. :?