Page 1 of 1

To pick max number from a job and use in another

Posted: Wed Sep 27, 2006 9:43 am
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.

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

Posted: Wed Sep 27, 2006 9:47 am
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.

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

Posted: Wed Sep 27, 2006 1:01 pm
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.

Posted: Wed Sep 27, 2006 1:06 pm
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.