Hi All,
I got a situation where I need to perform sub string operation. Can any one tell me how to do a substr action in Transformer ?
Sample data:
2004041 xxx yyy34
This is a fixed length data. the desired out put is
Output:
year month week name code rowNo
2004 04 1 xxx yyy 34
So needs to perform a sub string operation.
Thanks
What is substr equivalent for transformer
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 7
- Joined: Fri Jul 30, 2010 12:05 pm
- Location: Atlanta
You need to do is define the start point and length in bracket after the source column and map it to your target column, for instance...
YourColumnName[1,4] mapped to year
YourColumnName[5,2] mapped to ...
YourColumnName[7,1]
YourColumnName[9,3]
YourColumnName[13,3]
YourColumnName[16,2]
YourColumnName[1,4] mapped to year
YourColumnName[5,2] mapped to ...
YourColumnName[7,1]
YourColumnName[9,3]
YourColumnName[13,3]
YourColumnName[16,2]
_________________
- Susanne
- Susanne
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A word of warning. 2004041 might mean the 41st day of 2004. In that case you need to use StringToDate() with a mask of "%yyyy%ddd" to yield a date, then date component functions to extract the relevant pieces of date (year, month and day).
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.