running unix script from a job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

running unix script from a job

Post by RAJARP »

Hi,
I am having a shell script which gets max(emp_id) from database(oracle) and writes that value into a sequential file.
Now I want to design a job which would run the shell script first and then extract the max(emp_id) from sequential file and that max(emp_id) should be set as job paramater.please help me.thanks in advance,
Regards,
rajarp
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No you don't. You want to design a job sequence that does this.

This is because a job can not legally change its own parameter values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
satadru.kar
Participant
Posts: 14
Joined: Fri Dec 22, 2006 5:40 am
Location: Kolkata

Post by satadru.kar »

the other way arround to build a custom Stage, where you can spacify your unix script...
Thanks,
Satadru Kar
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

I can see two ways of doing this: (Both use a *job sequence*)

Write a basic routine which reads the contents of a file and puts the value in a User variable activity or a routine activity and then passes the value stored retrieved in the file to a downstream job.

Use the above logic. But, instead of a basic routine use a unix command and instead of a user variable activity use an Execute command activity.

The last is a bonus one ;) (Works only with server)

You can store the value which you want to pass as a job parameter in the *User status* of a job and then pass it to a downstream job.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

Minhajuddin wrote:I can see two ways of doing this: (Both use a *job sequence*)

Write a basic routine which reads the contents of a file and puts the value in a User variable activity or a routine activity and then passes the value stored retrieved in the file to a downstream job.

Use the above logic. But, instead of a basic routine use a unix command and instead of a user variable activity use an Execute command activity.

The last is a bonus one ;) (Works only with server)

You can store the value which you want to pass as a job parameter in the *User status* of a job and then pass it to a downstream job.


hi Minhajuddin and all,
thank you very much for ur patience.but i want to know how to write a routine which will get value from a sequential file and how can i set these extracted value as job parameter.can u please provide me with some sample routines r links from where i can get sample routines.i have searched various sites and forums.but i dint get any.please help me.
thanks in advance,

regards,
rajarp
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't need a routine. Use an Execute Command stage to 'type' the sequential file and capture the $CommandOutput, using it as a parameter in a downstream job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply