DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
ashok
Participant



Joined: 22 Jun 2004
Posts: 43

Points: 388

Post Posted: Fri Oct 15, 2004 7:28 pm Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Server
OS: Unix
Hi,
need help regarding spliting data from one field, and send it to two fields,

example:
ID | FIELD1 | FIELD2
MRPG2001 | |

RESULT:
ID | FIELD1 | FIELD2
MRPG2001 | MRP | G2001
kduke

Premium Poster


since February 2006

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 29 May 2003
Posts: 5101
Location: Dallas, TX
Points: 33944

Post Posted: Fri Oct 15, 2004 8:18 pm Reply with quote    Back to top    

The field() function can split it based on any one character separator.

field(Col1, '|', 2)

Will give you the second field using '|' as a separator.

_________________
Mamu Kim
Rate this response:  
Not yet rated
vmcburney

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 23 Jan 2003
Posts: 3527
Location: Australia, Melbourne
Points: 27331

Post Posted: Sun Oct 17, 2004 4:19 am Reply with quote    Back to top    

Have a look at the server job developers guide in your DataStage documentation. There is a section there on string functions. There are many ways to split up a string, the LEFT and RIGHT functions can split your string if you are always taking 3 and 5 characters.

_________________
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn: Vincent McBurney LinkedIn
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 39347
Location: Denver, CO
Points: 200968

Post Posted: Sun Oct 17, 2004 8:15 am Reply with quote    Back to top    

That and as another example, the ever popular substring operator - the square brackets. For example: MRPG2001[1,3] = MRP MRPG2001[4,5] = G2001 Best to read up as Vince suggested, so t ...

_________________
-craig

The moments seemed lost in all the noise, a snow storm, a stimulating voice
Of warmth of the sky, of warmth when you die
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours