Accessing Server job variable value from sequence job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
esuyanti
Participant
Posts: 10
Joined: Sun Feb 15, 2004 6:52 pm

Accessing Server job variable value from sequence job

Post by esuyanti »

Hi All,

I need to be able to access a variable value set in a server job from the job sequence that called the server job.

Any idea how I can achive this?

Thank you.

Cheers,

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

Post by kumar_s »

Iam not much clear with your requirment.
Do you need to access the value of the variable (parameter) set in the job sequence and pass it to underlying job?
Or do you need to access the value of the parameter set in the job to the job sequence which calls it?
Or do you need to access a value of stage variable set in a job by a job sequence?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
esuyanti
Participant
Posts: 10
Joined: Sun Feb 15, 2004 6:52 pm

Post by esuyanti »

Hi,

I have a job sequence that executes 2 server jobs in sequence (execute JobA and then execute JobB).
JobA transformer set a variable(not parameter) called "rej_reason".
I want to be able to access "rej_reason" value from the job sequence after JobA has been executed (i.e pass the "rej_reason" value to JobB).


Thanks

Cheers,

Elly

kumar_s wrote:Iam not much clear with your requirment.
Do you need to access the value of the variable (parameter) set in the job sequence and pass it to underlying job?
Or do you need to access the value of the parameter set in the job to the job sequence which calls it?
Or do you need to access a value of stage variable set in a job by a job sequence?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Unfortunately variables in jobs only exist while the job is running, i.e. they are not persistant. You can use a call to DSSetUserStatus({value}) in the job and then retrieve it in the parent sequence using DSGetJobInfo({JobHandle},DSJ.USERSTATUS)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably using

Code: Select all

DSGetParamInfo(hJob, ParamName, DSJ.PARAMVALUE) 
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
esuyanti
Participant
Posts: 10
Joined: Sun Feb 15, 2004 6:52 pm

Post by esuyanti »

Can I call DSSetUserStatus(value) from the server job transformer stage? If so, how? Because I tried to use it in stage variable and it gives me error message.

Thanks alot.

Cheer,
Elly


ArndW wrote:Unfortunately variables in jobs only exist while the job is running, i.e. they are not persistant. You can use a call to DSSetUserStatus({value}) in the job and then retrieve it in the parent s ...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, you can call it from a transform stage. You will not want to execute this for every row, though. Either in a before/after stage call or as a one time call in the initial value of a stage variable, depending upon how you get the value. The call is a function so it needs to be on the assignment side of a stage variable.
esuyanti
Participant
Posts: 10
Joined: Sun Feb 15, 2004 6:52 pm

Post by esuyanti »

Thanks..
Post Reply