How to hold some dynamic value during the Job run
Moderators: chulett, rschirm, roy
How to hold some dynamic value during the Job run
Hello!
I want to ask about the following:
I have a parallel job, inside which I'am getting the field value from Database.
My purpose is to find - how it is possible to hold this value during the Sequence run and, if necessary, use in downstream jobs. I.e. to hold the value in some variable.
I've tried to pass this value into Job Parameter - inside Transformer stage.
I tried to assign the Value directly to the Job Variable, for example insideTransformer's Stage Variable Section, in Derivation field:
JobParameter = DBColumn
Validation of this Derivation says that it's OK, but the value hadn't been assigned.
Searching this forum I have found that Job Parameters couldn't be changed or assigned during the job run.
So I need some another tool to hold values, obtained during the Job run.
I see this as it was realized in Informatica ETL tool, maping variables and workflow variables, there were ability to assign each value to another and hold the value which is obtained during the run.
What approach of using variables in DataStage, what will fit this task?
Thanks!
I want to ask about the following:
I have a parallel job, inside which I'am getting the field value from Database.
My purpose is to find - how it is possible to hold this value during the Sequence run and, if necessary, use in downstream jobs. I.e. to hold the value in some variable.
I've tried to pass this value into Job Parameter - inside Transformer stage.
I tried to assign the Value directly to the Job Variable, for example insideTransformer's Stage Variable Section, in Derivation field:
JobParameter = DBColumn
Validation of this Derivation says that it's OK, but the value hadn't been assigned.
Searching this forum I have found that Job Parameters couldn't be changed or assigned during the job run.
So I need some another tool to hold values, obtained during the Job run.
I see this as it was realized in Informatica ETL tool, maping variables and workflow variables, there were ability to assign each value to another and hold the value which is obtained during the run.
What approach of using variables in DataStage, what will fit this task?
Thanks!
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Hello Sainath.Srinivasan!Sainath.Srinivasan wrote:Are you looking for 'stage variables' or 'lookup stage' ?
I'm looking for some type of variable, which will be able to hold my value (which i've got inside the job) on the job level, not only at the stage level.
Correct me if Iam wrong, I thought that Stage Variable is accessible only inside the Stage and can not be accessed in other jobs that follows.
Yes, stage variables are local to a transformer. Perhaps a search for USERSTATUS would help? They can be accessed and transferred at the workflow... err, Sequence job level between jobs easily, especially if you use a Server job to stash that value.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hello chulett!
Thanks for the advice about USERSTATUS, seems it would require writing some routine. Also to concatenate several values with delimiter into one resulting string, before passing to another job.
I'll try it and then post a result.
A little question - does it matter if I have parallel Job or a Server Job, if there any restrictions to write into UserStatusArea, having parallel Job?
Thanks for the advice about USERSTATUS, seems it would require writing some routine. Also to concatenate several values with delimiter into one resulting string, before passing to another job.
I'll try it and then post a result.
A little question - does it matter if I have parallel Job or a Server Job, if there any restrictions to write into UserStatusArea, having parallel Job?
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
chulett, kumar_s - thanks!chulett wrote:Or use a BASIC Transformer? Does that not also work? Never had a chance to actually try that out...
I hadn't try to use BASIC Transformer for passing UserStatus in Parallel Job, with my experience I suppose it will be a bit time consuming. I'll try it during a period with less work loads
Thanks to you and some forum search, I reached the goal using a Server Job and DSSetUserStatus routine.
In this job I'am passing the concatenated parameters to UserStatus area, then by means of UserVariables Activity sequence deparsing the values with
Field(Job_Activity.$UserStatus,"|",[1..n]) function.
So seems that all futher job activities can see this variables and it's possible to assign it to Job parameters on a parallel sequence level.
That's exactly what I have done in the past, typically a Server job is perfectly suited for the task of gathering parameter style information even if the main processing 'needs' to be done using parallel technology. Then a Sequence job can easily parse apart the delimited USERSTATUS information from that job and any stage downstream of it can leverage them.
If you'll be doing that for multiple downstream stages, consider doing all of the parsing once in a UserVariables stage and then using them there (with their new 'proper names') downstream.
If you'll be doing that for multiple downstream stages, consider doing all of the parsing once in a UserVariables stage and then using them there (with their new 'proper names') downstream.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I can't envisage how DSSetUserStatus would work from multiple processing nodes. In parallel jobs you're better off writing to a file unless you call DSSetUserStatus from a BASIC Transformer stage constrained to execute on a single node.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.