Passing Parameter from table
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 151
- Joined: Fri Feb 13, 2009 4:19 pm
Passing Parameter from table
Hi I would like to know, if there is a way to pass a value from a table as parameter. For example we use sequence as the primary key so for the first time if the sequence is 1, 2, 3....100. Then the next time it should start from 101, 102, 103, ... etc. We have a surrogate_key table where we store the max(key/Seq). Can any body suggest how to retrieve this value (key/seq) from the surrogate_key table and use it in the job? Can we use a routine?
I don't want to use any database stage to retrieve this. Please advise me.
I don't want to use any database stage to retrieve this. Please advise me.
Thanks
Karthick
Karthick
Craig,
My issue posted earlier today was similar.
I read about USERSTATUS in documentation, but wasn't clear.
Could you please elaborate on it's usage.
Let us say, I am checking for a flag value ('Y' or 'N') from a DBstage, would I check, jobname.USERSTATUS='Y' on the stage's outer link? I mean USERSTATUS can be used to check column value from previous stage or stage status itself?
Thanks,
Spring
My issue posted earlier today was similar.
I read about USERSTATUS in documentation, but wasn't clear.
Could you please elaborate on it's usage.
Let us say, I am checking for a flag value ('Y' or 'N') from a DBstage, would I check, jobname.USERSTATUS='Y' on the stage's outer link? I mean USERSTATUS can be used to check column value from previous stage or stage status itself?
Thanks,
Spring
USERSTATUS is a 'single value' job level area that anyone can query after-job and see what is in there from the last run. Sequence jobs are the easiest way to leverage that, use the 'Insert Parameter Value' helper in any stage downstream of a Job Activity stage to see that <StageName>.$UserStatus is one of the available options.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
IN the server job you will need an interlude function to the DSSetUserStatus() routine.
Code: Select all
FUNCTION UpdateUserStatus(Arg1)
Call DSSetUserStatus(Arg1)
Ans = Arg1
RETURN(Ans)
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.
By "posted routine" I meant the UpdateUserStatus routine code that Ray posted in this thread. If you do an exact search for "Call DSSetUserStatus(Arg1)" you'll find that various incarnations of it have been posted close to a dozen times in these forums, most include explanations on how to leverage it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
As Ray would say, that's a problem that is easily solved. A Premium Membership would quickly pay for itself with the time it saves, you could have had this 'problem' solved within moments of coming online and searching. Heck, that's why I paid for one for the last three years.
Did you try the search I mentioned? Not everything here is "hidden" which is why I suggested it to you.
Did you try the search I mentioned? Not everything here is "hidden" which is why I suggested it to you.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
FUNCTION UpdateUserStatus(Arg1) Call DSSetUserStatus(Arg1) Ans = Arg1 RETURN(Ans& ...
The above is the code I got from Ray.
I got similar code : $INCLUDE DSINCLUDE JOBCONTROL.H
Call DSSetUserStatus(Arg1)
Ans = Arg1
Looks like this one is using header files and stuff.
Both of them would function same way, right? Am I missing a piece of code from Ray?
Also, I use this function and assign the derivation to a column in the job.
Regardless of what column I assign this function value to, Userstatus is set in this job and is available to next job activity in the sequence. Am I correct?
I am going to buy Premium membership soon![Smile :)](./images/smilies/icon_smile.gif)
Thanks,
Spring
The above is the code I got from Ray.
I got similar code : $INCLUDE DSINCLUDE JOBCONTROL.H
Call DSSetUserStatus(Arg1)
Ans = Arg1
Looks like this one is using header files and stuff.
Both of them would function same way, right? Am I missing a piece of code from Ray?
Also, I use this function and assign the derivation to a column in the job.
Regardless of what column I assign this function value to, Userstatus is set in this job and is available to next job activity in the sequence. Am I correct?
I am going to buy Premium membership soon
![Smile :)](./images/smilies/icon_smile.gif)
Thanks,
Spring
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's no need to include a header file if you don't use any of the content of the header file.
Since DSSetUserStatus is a subroutine and is cataloged as DSSetUserStatus then there's no actual need for JOBCONTROL.H.
Since DSSetUserStatus is a subroutine and is cataloged as DSSetUserStatus then there's no actual need for JOBCONTROL.H.
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.
Yup.springwtr wrote:Also, I use this function and assign the derivation to a column in the job. Regardless of what column I assign this function value to, Userstatus is set in this job and is available to next job activity in the sequence. Am I correct?
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: