Parameter From Unix Script

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
dtatem
Participant
Posts: 54
Joined: Wed Jun 09, 2004 7:50 am

Parameter From Unix Script

Post by dtatem »

Hello To All:

Is there a way to run a Unix shell script from within a DataStage job, get the value returned by it, and assign it to a job-parameter to be used in existing job(s)

Thanks

dtatem
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Parameter From Unix Script

Post by gateleys »

dtatem wrote:Hello To All:

Is there a way to run a Unix shell script from within a DataStage job, get the value returned by it, and assign it to a job-parameter to be used in existing job(s)

Thanks

dtatem
You can't set the parameter of a job from within the same job. It will have to be done externally, say via the job sequence. You could write a routine with a DSExecute to fire the shell script and capture the return value. This routine may be triggered via a Routine Activity. Now, at the sequence level, the return value of Routine Activity can set the value of the job parameter of the specific job.

gateleys
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

As suggested this can not be done in the job itself. However the approach suggested by gateleys adds an unnecessary layer of software; instead of a Routine activity, I would recommend an Execute Command activity to execute your script, upstream of your Job activity in a job sequence. The activity variable $ReturnValue can be used to retrieve the command's output for passing into a job parameter. You may need to Trim field marks (line terminators) from the script's output.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply