replace
Moderators: chulett, rschirm, roy
Re: replace
adams06 wrote:Hi,
how to replace a leading prefix with 'xyz'
Thanks in advance
Please do the follwing steps in the same order
1) Open your online datastage help
2)Goto Search
type
Code: Select all
string functions
try to use one or more of the functions listed to achieve your result
replace
chulett wrote: You might want to give just a wee bit more detail... and an example.
Here are the examples
B-CDE PASS "NEED TO REPLACE B WITH XYZ"
A-HJU PASS "NEED TO REPLACE A WITH XYZ"
AHJU PASS "NEED TO REPLACE A WITH XYZ"
Thanks in Advance.
If you mean replace everything in front of the first "-" with something else. I think you have a few choices. One is using the FIELD function. The other is to use the INDEX function and substring notation.
Write a DS Function and test both of these:
or
Write a DS Function and test both of these:
Code: Select all
Ans="XYZ":"-":FIELD(Arg1,"-",2,999)
Code: Select all
Ans="XYZ":Arg1[INDEX(Arg1,"-",1),LEN(Arg1)]
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 73
- Joined: Wed Jun 28, 2006 3:27 pm
- Location: NJ
-
- Participant
- Posts: 73
- Joined: Wed Jun 28, 2006 3:27 pm
- Location: NJ
-
- Charter Member
- Posts: 166
- Joined: Wed Mar 16, 2005 6:52 am
- Location: Mumbai, India
the following can save you a routine call
You can use the following derivation in a transformer Stage variable or output Derivation
You can use the following derivation in a transformer Stage variable or output Derivation
Code: Select all
"xyz" : in.col[len(in.col)-1]
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
Even shorted derivation:
Code: Select all
"xyz":In.Col[2,99999]
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Or:
Code: Select all
"xyz":In.Col[2,Len(In.Col2)]
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers