Page 1 of 1

Returing a value from one job to another

Posted: Sun Mar 16, 2008 2:23 am
by VCInDSX
I have a scenario where Job-A has the logic to load data from a source file into a target data table. This is an RCP PX job that takes several job parameters (Input source file name, RCP Schema file name, DB Connection details et al). One piece of information that gets fed into this job is the type of load namely, full or delta. This job is plugged into a sequence.

Now a database function exists that is used to determine what type of load should happen on a given day. All this function does is return a value of type VarChar(3). If I write a separate job (Job-2) to get the load-type using this db function I can easily pass that information to Job-A. To accomplish this i would plug this new job as a pre-processing job in my sequence.

What is the best approach to pass this information from Job-2 to Job-A? Can job-2 pass this to Job-A via user variables? or should i resort to writing the output from Job-2 into text file and then reading it in Job-A?
Might there be another approach(es). Would appreciate your feedback.

Thanks in advance for your time,

Posted: Sun Mar 16, 2008 3:06 am
by ray.wurlod
The jobs are independent of each other. Therefore you need to persist the information somewhere. A text file is as good a place as any, and is easy to read with an Execute Command activity or a Routine activity.

You might also consider using a server job for processing the one row, then you can readily store the value in the job's user status area and recover it using the Job activity's $UserStatus activity variable. (You can use the user status area in parallel jobs also, but there is no routine provided for setting it from the parallel Transformer stage.)

Posted: Tue Mar 18, 2008 9:08 am
by VCInDSX
Ray,
Thanks for the input. I should have searched a bit more.... apologies.
I found a lot of links here on this topic. The following link helped a lot. viewtopic.php?t=99399&highlight=user+variables

I went with the Server Job approach as it is just a single record that is returned from Job-1 and the output link goes to the "Black hole"

Thanks,

Posted: Tue Mar 18, 2008 9:14 am
by chulett
So... resolved?

Posted: Wed Mar 19, 2008 7:41 am
by VCInDSX
Thanks Craig.

Marked as Resolved...