To pick max number from a job and use in another

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
adams06
Participant
Posts: 92
Joined: Sun Mar 12, 2006 3:00 pm

To pick max number from a job and use in another

Post by adams06 »

Hi,

I need to pick up the max value that is generated by job1, and use it in job2?

For job1 i have used KeyMgtGetNextValue('x').

for job2 can i use the KeyMgtGetMaxKey('x')?

Any ideas

Thanks in advance.
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Re: To pick max number from a job and use in another

Post by DeepakCorning »

Three ways that I can think of doing this -

1. Make the number a Job parameter in the Job 2 and trigger Job 2 from Job 1 and pass the paramter while triggering it.

2. Use a Hashed file/Seq File to store that value Job 1 and use the file in the Job 2.

3. Use the function KeyMgtGetNextValue.
ktgillen
Charter Member
Charter Member
Posts: 7
Joined: Tue Oct 11, 2005 7:41 am
Location: West Lafayette, IN
Contact:

Re: To pick max number from a job and use in another

Post by ktgillen »

adams06 wrote:Hi,

I need to pick up the max value that is generated by job1, and use it in job2?

For job1 i have used KeyMgtGetNextValue('x').

for job2 can i use the KeyMgtGetMaxKey('x')?

Any ideas

Thanks in advance.
Use the SetUserStatus function. FUNCTION SetUserStatus(ID)
Call DSSetUserStatus(ID)
Ans = ID
RETURN(Id)

Pass your job1's max value to user status. When you combine both the jobs ina sequence you can use the status of the first job as a value in the paramter for the second job.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or, you can also get the max value from job1, load it into a hashed file with a dummy key and access that hashed file with the dummy key in your second job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply