Page 1 of 1

passing value of one job to another

Posted: Wed Mar 26, 2008 9:16 am
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

Posted: Wed Mar 26, 2008 2:49 pm
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.

Re: passing value of one job to another

Posted: Wed Mar 26, 2008 3:10 pm
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.

Posted: Thu Mar 27, 2008 8:03 am
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

Posted: Thu Mar 27, 2008 8:03 am
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

Posted: Thu Mar 27, 2008 5:02 pm
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.)

Posted: Thu Apr 03, 2008 7:24 am
by sri75
Ray,thanks for your reply.my job is working.

Thanks

Posted: Fri Jun 27, 2008 4:52 am
by manuel.gomez
This post really helped me out, thanks very much guys!!!!

Posted: Wed Aug 13, 2008 3:38 pm
by csri
Thanks guys. This post is very clear and helped.