Returing a value from one job to another

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
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Returing a value from one job to another

Post 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,
-V
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post 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,
-V
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... resolved?
-craig

"You can never have too many knives" -- Logan Nine Fingers
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post by VCInDSX »

Thanks Craig.

Marked as Resolved...
-V
Post Reply