Executing dsjob command from routine activity

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

Moderators: chulett, rschirm, roy

samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Executing dsjob command from routine activity

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

Re: Executing dsjob command from routine activity

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

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: Executing dsjob command from routine activity

Post by samyamkrishna »

The job names ( the invocation id ) and parameters are decided at run time.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

Hi craig,

Its the built in ExecSH routine.

the argumet is "dsjob -run PROJ JOBNAME"
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post 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.
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

Do you need to specify -wait in the dsjob command?
Phil Hibbs | Capgemini
Technical Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post 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.
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

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

Post by chulett »

Groucho Marx. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post 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
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Post by samyamkrishna »

we are going with Execute command activity. :?
Post Reply