Page 1 of 1

result of a query in a variable activity

Posted: Thu Oct 22, 2009 4:16 am
by LAS
Hello

I'm using a sequencer job containing 3 server jobs (SJ1, SJ2 and SJ3).
SJ1 is linked to SJ2 and SJ3.
I have a parameter table (Oracle Database). One parameter indicates the path to take in the sequencer.
If parameter = 2 then SJ2 must run and SJ3 is ignored.
If parameter = 3 then SJ3 must run and SJ2 is ignored.
To do that, I have to read the parameter in the table and then evaluate the value in the triggers of SJ1.

Thanks to DSXchange, I found a link to a solution on www.anotheritco.com but I would like to know if it is possible to read the value of the parameter in a database and store it in a variable activity without using an intermediate file ?

Posted: Thu Oct 22, 2009 4:25 am
by DS_SUPPORT
Welcome...

In SJ1, you can read the value from the database and set the value to user status by using "DSSetUserStatus". And you can fetch the values in the Sequence job by using SJ1's jobactivity.$UserStatus.

Search the forum for the keyword DSSetUserStatus, you will get more details on how to use it.

yes but ...

Posted: Thu Oct 22, 2009 7:26 am
by LAS
Thanks.
I did a search as you adviced.
I found 125 answers with the keyword DSSetUserStatus. It's a bit long to read but it's effective. Here is a summary of the solutions.

Step 1 : I create a routine like that :

Code: Select all

FUNCTION SetUserStatus(Arg1)
Call DSSetUserStatus(Arg1)
Ans = Arg1
Step 2 : I create a job SJ1 with 3 stages :
Stage1 (ORAOCI9) read the parameter from the table
Stage2 (Transformer) use the function SetUserStatus in Derivation
Stage3 (Sequential file) write the value in a file

Step 3 : I call the job SJ1 in a sequencer and I use $UserStatus in the expression of a custom conditionnal trigger to determine the next job to execute.

It works but I still have the intermediate file (Stage3 in the Step2).
How can I use the transformer without writing something in a file or a database ?
Do I really need to use a transformer to call the function SetUserStatus ?

Posted: Thu Oct 22, 2009 7:41 am
by DS_SUPPORT
For a transformer , definetly an output link should be there, but you can set the constraint to @FALSE, so nothing will be written to that file.

If you want to store some constant values to the userstatus, you can just call it in stage subroutines, but here you are fetching some values from Database and writing it user status, so i think you need a transformer here.

There might be some other ways also, which i am not aware. Please wait for our expert's comments.

sorry I'm lost

Posted: Thu Oct 22, 2009 7:47 am
by LAS
DS_SUPPORT wrote:but you can set the constraint to @FALSE
I don't understand.
What does it means ? How can I do that ?

Posted: Thu Oct 22, 2009 8:49 am
by chulett
It means nothing would ever leave the transformer down that link. You could also write the file to "/dev/null".

Posted: Thu Oct 22, 2009 3:45 pm
by ray.wurlod
Have the Sequential File stage append to /dev/null (UNIX) or .\NUL (Windows). Then you have no file created.

Posted: Fri Oct 23, 2009 1:06 am
by LAS
Ok for the solution with /dev/null.
I'd like to understand the solution which consist in setting the constraint to @FALSE as proposed by DS_SUPPORT

Where can I set this constraint ?

Posted: Fri Oct 23, 2009 6:12 am
by LAS
Where can I set this constraint ?
I find it. Sorry, I was not awake. :oops:

Posted: Fri Oct 23, 2009 7:02 am
by chulett
:wink: