Passing Set of values from a data base table to Sequence 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
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Passing Set of values from a data base table to Sequence Job

Post by sjordery »

Hi ,

I want to pass 4 distinct values from a data base table to a Sequence job.
I have defined 4 parameters to catch the values.
Is there any method to read and pass it to the job parameters.


Thanks in Advance!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Lots of ways. My preferred way is as follows.

Create a server job to catch all four in a single string and load that into the job's user status area, and read that from the Job activity's $UserStatus variable and parse with Field functions.

Code: Select all

SELECT v1 || ';' || v2 || ';' || v3 || ';' || v4 FROM table WHERE condition ;
(make sure it returns just one row)

Code: Select all

Field(FetchJob.$UserStatus, ";", 1,1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

Thanks Ray for your suggestion.
I have some confusion on this could you please explain

1-1st I will read the values from the table using any dabase stage then how to load the string to job's user status area which will be used in another sequence job?
2-Is the Sequence job will depedent on this job?


Thanks,
sjordery.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

1. Search - both the DSSetUserStatus routine and an interlude function exist on DSXchange.

2. Yes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

Thanks Ray!
I did exactly as mentioned to set the status of the job with a value by invoking a routine which calls DSSetUserStatus function and it worked fine.

If we need to catch more than one value and pass it to set of parameters in a sequence job then ,do we need to design those many jobs or can we do this in the same job.

Regards,
Sjordery.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Put them in a delimited string and then parse it back into the component pieces after fetching it from the user status area.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... which is exactly what I suggested when you asked about four values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why, so you did. I didn't bother to scroll back that far. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply