passing value of one job to another

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
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

passing value of one job to another

Post by sri75 »

Hi ,

I need to pass values of one variable to another job.

by going through previous posts, I got some idea about using DSSetUserStatus .

still I don't understand how to use it.

I have one job say JOB1 which reads record count of the table

job is like this


oraclestage--------------- transformer -------------seqfile

values is assigned to column name COUNT in sequential file.need to pass the value of COUNT to another job.

I got this code from this site.

Code: Select all

FUNCTION userstatus(Arg1)
Call DSSetUserStatus(Arg1)
Ans = Arg1
RETURN(Ans)
in the transformer stage i called this function on column COUNT like this
userstatus(DSLink113.COUNT )

in the sequence, I have 2 job activity stages

JOB1---------JOB2

I tries to get the value like thi

JOB1.$UserStatus.but it is not returning the value from 1st job

can you please give me any idea

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

Post by ray.wurlod »

Change your routine to log a message to prove that it's operating. If it is, then show us how and where you're trying to use the activity variable.
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

Re: passing value of one job to another

Post by chulett »

sri75 wrote:I tries to get the value like this JOB1.$UserStatus but it is not returning the value from 1st job
Make sure "JOB1" is the name of the Job Activity stage that runs the job, the name of the actual job doesn't matter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

Thanks Ray and Craig

I tested the routine in manager it is returning results without any problem.

this is my job design

JOB1


src --------------transformer -------------sequential

I queried the record count of table into a column COUNT and passed to transformer in the derivation of the column called the transform function like this
userstatus(DSLink113.COUNT )
ran the job , column COUNT has record count


in the second job JOB2

added job parameter say recordcount

src-----------------transformer -----------------target

in the transformer , I added new column say COL1 , in the derivation I added recordcount parameter

in sequence job

jobactivity1 --------------jobactivity2

in jobactivity1, just called first job JOB1 and didn't change trigger expression and in jobactivity2 for parameter recordcount assigned value expression like this JobActivity1.$UserStatus

did I miss anything here ?

Thanks
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

Thanks Ray and Craig

I tested the routine in manager it is returning results without any problem.

this is my job design

JOB1


src --------------transformer -------------sequential

I queried the record count of table into a column COUNT and passed to transformer in the derivation of the column called the transform function like this
userstatus(DSLink113.COUNT )
ran the job , column COUNT has record count


in the second job JOB2

added job parameter say recordcount

src-----------------transformer -----------------target

in the transformer , I added new column say COL1 , in the derivation I added recordcount parameter

in sequence job

jobactivity1 --------------jobactivity2

in jobactivity1, just called first job JOB1 and didn't change trigger expression and in jobactivity2 for parameter recordcount assigned value expression like this JobActivity1.$UserStatus

did I miss anything here

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

Post by ray.wurlod »

Your design is good (provided the job activity name is correctly spelled and cased when used in the job parameter expression). What value are you getting? (Look in the log for the parameter value.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

Ray,thanks for your reply.my job is working.

Thanks
manuel.gomez
Premium Member
Premium Member
Posts: 291
Joined: Wed Sep 26, 2007 11:23 am
Location: Madrid, Spain

Post by manuel.gomez »

This post really helped me out, thanks very much guys!!!!
csri
Participant
Posts: 99
Joined: Wed Jul 11, 2007 8:02 am

Post by csri »

Thanks guys. This post is very clear and helped.
Post Reply