pass value between jobs

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

PeterPol
Premium Member
Premium Member
Posts: 73
Joined: Wed Mar 08, 2006 8:59 am

pass value between jobs

Post by PeterPol »

hi all,

One way to pass a value from one job to another is by using userstatus (DSSetUserstatus). I somewhere else read (and experienced) that this routine can only be used in serverjobs. What mechanism(s) can be used in px jobs for passing values?

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

Post by ray.wurlod »

What value do you want to pass?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PeterPol
Premium Member
Premium Member
Posts: 73
Joined: Wed Mar 08, 2006 8:59 am

Post by PeterPol »

Hi ray,

No value in particular. Any value that I want to pass to other jobs that follow in the sequence. For instance, a table value that I want to retrieve once, and use in other jobs that come after this one.

Peter
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

There are methods advised here. Search to get a few revealed :D
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For one value, I'd still recommend the user status area. Use a server job (or a fully sequential parallel job that includes a BASIC Transformer) to obtain that value and store it in its user status area. Use the parent job sequence to retrieve that job's user status value, and supply that as the value with which to replace a job parameter in the main job.

If you don't want to do that, there are numerous other storage locations available, such as a text file, a row in a table, an environment variable and so on. To retrieve the value of an environment variable, you would need some way to execute either the DataStage command ENV or the operating system command echo in your job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PeterPol
Premium Member
Premium Member
Posts: 73
Joined: Wed Mar 08, 2006 8:59 am

Post by PeterPol »

Hello ray,

I tried passing a userstatus in a Basic transformer (from a fully sequential parallel job, as you suggested) to the parent job, but this doesn't work. I get the following warning:

subjob(BASIC_Transformer_3).#0.BASIC_Transformer_3 (DSSetUserStatus): Error reading Job Status record. JobNo = 646 JobName = subjob.#0 WaveNo = 1

Peter
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

How are you trying it?
Write a routine which calls the UserStatus function. It has been discussed serveral times.
Following will be the code for the function.

Code: Select all

INCLUDE DSINCLUDE JOBCONTROL.H
*FUNCTION UpdateUserStatus(Arg1)
Call DSSetUserStatus(Arg1)
Ans = Arg1
RETURN(Ans)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

PeterPol wrote:Hello ray,

I tried passing a userstatus in a Basic transformer (from a fully sequential parallel job, as you suggested) to the parent job, but this doesn't work. I get the following warning:

subjob(BASIC_Transformer_3).#0.BASIC_Transformer_3 (DSSetUserStatus): Error reading Job Status record. JobNo = 646 JobName = subjob.#0 WaveNo = 1

Peter
The strategy of using a BASIC transformer in a parallel job will not work in a MPP system. It works only in SMPs ... according to Datastage documentation.
Last edited by sud on Thu Feb 01, 2007 5:34 am, edited 1 time in total.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
PeterPol
Premium Member
Premium Member
Posts: 73
Joined: Wed Mar 08, 2006 8:59 am

Post by PeterPol »

Hello,

I have a routine named PublishUserStatus(arg1) that calls the userstatus function, as you adviced:

Call DSSetUserStatus(Arg1)
Ans = 0

Peter
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Or straigt away use Server job.
viewtopic.php?t=95608&highlight=waveno
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

Is that just a warning or a fatal error?
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

subjob(BASIC_Transformer_3).#0.BASIC_Transformer_3 (DSSetUserStatus): Error reading Job Status record. JobNo = 646 JobName = subjob.#0 WaveNo = 1
I received similar warning not long ago when i tried to set userstatus using basic transformer . Not sure as to what the problem is.
As noted, it is better to do the same in server jobs.
PeterPol
Premium Member
Premium Member
Posts: 73
Joined: Wed Mar 08, 2006 8:59 am

Post by PeterPol »

hi,

Setting the userstatus is no problem in server jobs. I already experienced that. However, server jobs are very limited in processing possibilities, so I prefer to develop most things in parallel jobs.

Ray mentioned some alternatives like storing the value in a textfile or using environment variables. The first option seems rather time-consuming to me :? . The second option is new for me :?:

Peter
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

PeterPol wrote:However, server jobs are very limited in processing possibilities, so I prefer to develop most things in parallel jobs.
A simple storage of a value to be retrieved later on is best to be done in a server job. Its a small job and hence preferably done in server. For massive processing use parallel jobs.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

PeterPol wrote:However, server jobs are very limited in processing possibilities, so I prefer to develop most things in parallel jobs.
Interesting statement. I completely disagree but that's not a topic for this thread. :wink:
-craig

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