Assigning value to job paramerter in 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
skaruturi
Participant
Posts: 10
Joined: Wed Sep 13, 2006 2:17 am

Assigning value to job paramerter in job

Post by skaruturi »

we want to assign a value to job parameter.The parameter has to take max value of a key column so that we use this job parameter to used as stat value in serrogate key generator stage
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

There are various ways to do this.

The one which we have used is - We have created on more job. This job gets the maximum value of the ID column from table. Then in from this job we call other job using DSJOB command from this job.
This was done in server.

One more way to do this is call the job from script. The script can extract the maximum value and then pass this value as param value in the DSJOB command.
Regards,
S. Kirtikumar.
skaruturi
Participant
Posts: 10
Joined: Wed Sep 13, 2006 2:17 am

Post by skaruturi »

Hi Karthik,

can the same approach be used for parallel job

Thanks,
Karuturi
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

Create a routine to Read the maximum value from the table, and then call this routine in User variable Activity stage, and assign the return value to the parameter.
kool78
Participant
Posts: 104
Joined: Sat Aug 20, 2005 2:02 pm

Post by kool78 »

keshav0307 wrote:Create a routine to Read the maximum value from the table, and then call this routine in User variable Activity stage, and assign the return value to the parameter.

As Keshava said,

U can also write the max value into a sequential file and then read that value(by calling basic routine) using user variables activity in sequence. and assign the output of the uservariable avtivity to your job parameter.
"Attitude always and almost determines the altitude of your Life"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Always Routines!!!

Create a server job to get the maximum value (no point creating a parallel job to process one row). Have this job put the value into its user status area. Use the $UserStatus activity variable to supply the parameter value.

Have you thought through the appropriate mechanism for generating a sequence of unique numbers when executing in parallel mode?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kool78
Participant
Posts: 104
Joined: Sat Aug 20, 2005 2:02 pm

Post by kool78 »

ray.wurlod wrote:Always Routines!!!

Create a server job to get the maximum value (no point creating a parallel job to process one row). Have this job put the value into its user status area. Use the $UserStatus a ...


HI ray..

a small request , can you please post the premium content for this post.

Thanks
"Attitude always and almost determines the altitude of your Life"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This site uses the "premium poster" concept as a means for funding the site. The revenue comes nowhere near paying for the site, but it helps.

The added value provided by these few posters ought to make it worth your while to invest the less than $1 per week required for a premium membership.

It is not appropriate for me - or anyone else - to accede to your request.
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