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



Joined: 16 Nov 2017
Posts: 2

Points: 18

Post Posted: Thu Jan 21, 2021 4:20 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Server
OS: Unix
Hi Team,

I'm looking for a server routine to split a string dynamically with 15 characters but each record should end with complete word.

ex: string value: "ABC DEFG HIJ KLM NOP COUNTRY STATE WORLD"
I would like to split by char length :15

Expected results:
ABC DEFG HIJ
KLM NOP COUNTRY
STATE WORLD

please help ..

Thank you
Sekhar
Finki
Participant



Joined: 21 Dec 2020
Posts: 9
Location: Kleinblittersdorf
Points: 191

Post Posted: Wed Feb 03, 2021 5:50 am Reply with quote    Back to top    

Das ist sehr schwer, aber es geht. Du musst es immer der Reihe nach machen, also
1-15, dann 15-30, dann 30-45 usw. Verstehst du?
Hier die Syntax, rechts steht immer welche Länge du benötigst:

(LEFT(DSLink5.DATENSATZ,15))
TRIMF(DSLink5.DATENSATZ)[15,15]
TRIMF(DSLink5.DATENSATZ)[30,15]
TRIMF(DSLink5.DATENSATZ)[45,15]


DSLink5.DATENSATZ musst du bei dir durch deine Variable ersetzen.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

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

Joined: 23 Oct 2002
Posts: 54621
Location: Sydney, Australia
Points: 296179

Post Posted: Fri Feb 12, 2021 2:59 am Reply with quote    Back to top    

Code:
Fmt(InLink.MyString, "15T")
returns a delimited string. Use a loop in the Transformer stage to output one substring per line.

_________________
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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