Splliting of 1 Input col into 4 Output cols on word boundary

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sambit
Participant
Posts: 52
Joined: Mon Sep 05, 2005 4:59 am

Splliting of 1 Input col into 4 Output cols on word boundary

Post by sambit »

Here is my requirement :-

My i/p column is 160 chars. I need to populate 4 o/p cols (each 40 chars) from this i/p col by splitting it on word boundary. How do I do so in Server edition.

Thanks in advance,
Sambit
Thanks !!!
Sambit
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Etiquette Note
When a problem has been solved, the OP marks the thread as Resolved and adds a post indicating how the problem was solved, to aid future searchers.


I suspect you used either the Fmt() or the Fold() function after searching the forum, but it would be nice to know exactly what you did do.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sambit
Participant
Posts: 52
Joined: Mon Sep 05, 2005 4:59 am

Re-Opening this Thread

Post by sambit »

Hi All,
I am re-opening this thread inorder to get some better ideas from the forum. Please let me know incase of any solutions.

Thanks,
Thanks !!!
Sambit
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Better ideas than what? What have you tried so far?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sambit
Participant
Posts: 52
Joined: Mon Sep 05, 2005 4:59 am

Post by sambit »

Well... Actually we though thought of using the substring approach but it seems that this is the not the best approach when we are trying to split the data on Word Boundary. Data is being truncated.
Thanks !!!
Sambit
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Place a dynamic array, derived as follows, into a stage variable.

Code: Select all

Fmt(InLink.TheString,"40T")

Then use Field() functions with @TM as the delimiter to extract the four lines. For example, to extract the second line:

Code: Select all

Field(svChoppedLine, @TM, 2, 1)

The only change for the other lines is the third argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply