When you ask how, is it where do you place that stage in the JobSequence or how do you call the routine within the UserVariableActivity stage or is it both?
There is a routine activity stage as well. You need to create a user variable before you use it. So if you need a parameter calculated then you can call either a routine activity or create a user variable before or both. In the formula for a user variable you can call routines as well just like in any derivation.
When you ask how , is it where do you place that stage in the JobSequence or how do you call the routine within the UserVariableActivity stage or is it both?
I found the user variable stage and I will assume it goes before the job sequence and from there I can call my parameters array routine (thanks to finding in this site) but from there, how do you change the parameters set already in the sequencer with the ones in the parameter array? and once is set with the new parameters can they be used for the subsequent Sequencers?
I created a variable in the user variable activity. I have a job activity stage after that in the sequencer. How do I populate the variable in the user variable activity by callling the job in the job activity stage?
splayer wrote:How do I populate the variable in the user variable activity by callling the job in the job activity stage?
You don't populate user variable by calling the job. You use the variable created in the UserVariableActivity Stage in the downstream Job activity stage.
Ok. I have the job activity stage as a downstream activity from the user activity stage. I have created the variable in the user activity stage. Now, in my downstream job activity stage, how do I store a value in the variable of the user activity stage?
So let's say I have:
UA ---> JA1 ----> JA2 -----> JA3 ------> JA4
UA has a variable called Var1.
In JA1, I would like to read a value from a file and set Var1 to that value, let's say 5. Then in JA4, I would like to increase the value by 1 and write back the value to the file.
You cannot do it directly. You have to write it somewhere in the job so the sequence can read it using UtilityHashLookup or a similar routine. The surrogate key routine is a similar concept. Some process needs to put the first value in SDKSequences hashed file. Each call to the routine adds one to the value and writes it back. Look at this routine's code. It is very simple. This does not need to be a surrogate key. The same concept would work for last run date. Job1 select max(extract_date) from my_fact_table and writes to hashed file HF_ETL_CHECKPOINT. Next a user variable is assigned this value using a call to routine UtilityHashLookup.
This is what I did. I have a hash file with 2 columns, KeyCol and ValueCol. I just have one row in there with values of 1 and 0. I have a job which has transformer and hash file stage. In the transformer, I have the expression as
UtilityHashLookup("/mypath/HashFile", 1, 1)
where HashFile is the name of the hash file being looked up. However, in my destination hash file I don't see any data. My eventual objective is to replace this value of 0 with a value of 1. For now, I am just wrting to a different hash file.
The SeqFileStage is there just to prevent compiler errors. It has no role. In the transformer, I look up the hash file as:
UtilityHashLookup("/MyPath/JCF_Hash", 1, 1)
1: KeyValue
1: Value position. Neither 1 nor 2 works.