Trying to extract 1st 2 chars from a string but the job got aborted with the error message "Error parsing modify adapter: Error in binding: Expected source field selector; got: "20070705"
Expected destination field selector, got: ")"; input:" and the code that is applied in Modify stage, is below.
MISTR:string[2] = substring[1,2] (#BIZDATE#), where BIZDATE is the parameter and '20070705' was passed while executing the job.
Let me know what is wrong and whether parameter can be used in the derivation.
Thanks
Elavenil
Substring extraction
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Substring syntax looks alrite for me.
or is this not the right syntax? Passing job parameter into that syntax can be the issue?OutputField=substring [startPosition,len] (InputField)
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Use the square brackets. They are perfectly viable solution for substrings in both server and parallel editionsgateleys wrote:Check the type of your parameter in its definition. May be it is other than a string.JoshGeorge wrote:Substring syntax looks alrite for me.or is this not the right syntax? Passing job parameter into that syntax can be the issue?OutputField=substring [startPosition,len] (InputField)
More you can find from below link, which DSguru2B has posted.
viewtopic.php?t=111106&highlight=substring
Regards,
Abburi
Abburi
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Abburi, you are thinking of the Transformer stage, not the Modify stage.
Elavenil, in another post I discussed the inviability of using job parameters in Modify stage.
Note also that the Modify stage positional argument is zero based, therefore the first two characters in a string are 0 and 1. So you would needwhere BIZDATE is the name of the input column generated upstream from the Modify stage, using a job parameter reference perhaps in a Column Generator stage.
Elavenil, in another post I discussed the inviability of using job parameters in Modify stage.
Note also that the Modify stage positional argument is zero based, therefore the first two characters in a string are 0 and 1. So you would need
Code: Select all
MISTR:string[2] = substring[0,2](BIZDATE)
Last edited by ray.wurlod on Thu Sep 06, 2007 8:10 pm, edited 1 time in total.
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.
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Yeah, modify stage dosen't like job parameter substituted in its operator calls.
or is this not the right syntax? Passing job parameter into that syntax can be the issue?[/quote]JoshGeorge wrote:Substring syntax looks alrite for me.OutputField=substring [startPosition,len] (InputField)
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>